}
static void
-x_dnd_send_enter (struct frame *f, Window target, int supported)
+x_dnd_send_enter (struct frame *f, Window target, Window toplevel,
+ int supported)
{
struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
int i;
msg.xclient.type = ClientMessage;
msg.xclient.message_type = dpyinfo->Xatom_XdndEnter;
msg.xclient.format = 32;
- msg.xclient.window = target;
+ msg.xclient.window = toplevel;
msg.xclient.data.l[0] = FRAME_X_WINDOW (f);
msg.xclient.data.l[1] = (((unsigned int) min (X_DND_SUPPORTED_VERSION,
supported) << 24)
}
static void
-x_dnd_send_position (struct frame *f, Window target, int supported,
- unsigned short root_x, unsigned short root_y,
- Time timestamp, Atom action, int button,
- unsigned state)
+x_dnd_send_position (struct frame *f, Window target, Window toplevel,
+ int supported, unsigned short root_x,
+ unsigned short root_y, Time timestamp, Atom action,
+ int button, unsigned state)
{
struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
XEvent msg;
msg.xclient.type = ClientMessage;
msg.xclient.message_type = dpyinfo->Xatom_XdndPosition;
msg.xclient.format = 32;
- msg.xclient.window = target;
+ msg.xclient.window = toplevel;
msg.xclient.data.l[0] = FRAME_X_WINDOW (f);
msg.xclient.data.l[1] = 0;
}
static void
-x_dnd_send_leave (struct frame *f, Window target)
+x_dnd_send_leave (struct frame *f, Window target, Window toplevel)
{
struct x_display_info *dpyinfo = FRAME_DISPLAY_INFO (f);
XEvent msg;
msg.xclient.type = ClientMessage;
msg.xclient.message_type = dpyinfo->Xatom_XdndLeave;
msg.xclient.format = 32;
- msg.xclient.window = target;
+ msg.xclient.window = toplevel;
msg.xclient.data.l[0] = FRAME_X_WINDOW (f);
msg.xclient.data.l[1] = 0;
msg.xclient.data.l[2] = 0;
}
static bool
-x_dnd_send_drop (struct frame *f, Window target, Time timestamp,
- int supported)
+x_dnd_send_drop (struct frame *f, Window target, Window toplevel,
+ Time timestamp, int supported)
{
struct x_display_info *dpyinfo;
XEvent msg;
if (x_dnd_action == None)
{
- x_dnd_send_leave (f, target);
+ x_dnd_send_leave (f, target, toplevel);
return false;
}
msg.xclient.type = ClientMessage;
msg.xclient.message_type = dpyinfo->Xatom_XdndDrop;
msg.xclient.format = 32;
- msg.xclient.window = target;
+ msg.xclient.window = toplevel;
msg.xclient.data.l[0] = FRAME_X_WINDOW (f);
msg.xclient.data.l[1] = 0;
msg.xclient.data.l[2] = 0;
}
static bool
-x_dnd_do_drop (Window target, int supported)
+x_dnd_do_drop (Window target, Window toplevel, int supported)
{
if (x_dnd_waiting_for_status_window != target)
- return x_dnd_send_drop (x_dnd_frame, target,
+ return x_dnd_send_drop (x_dnd_frame, target, toplevel,
x_dnd_selection_timestamp, supported);
x_dnd_need_send_drop = true;
if (x_dnd_last_seen_window != None
&& x_dnd_last_protocol_version != -1)
x_dnd_send_leave (x_dnd_frame,
- x_dnd_last_seen_window);
+ x_dnd_last_seen_window,
+ x_dnd_last_seen_toplevel);
else if (x_dnd_last_seen_window != None
&& !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style)
&& x_dnd_last_motif_style != XM_DRAG_STYLE_NONE
if (x_dnd_last_seen_window != None
&& x_dnd_last_protocol_version != -1)
x_dnd_send_leave (x_dnd_frame,
- x_dnd_last_seen_window);
+ x_dnd_last_seen_window,
+ x_dnd_last_seen_toplevel);
else if (x_dnd_last_seen_window != None
&& !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style)
&& x_dnd_last_motif_style != XM_DRAG_STYLE_NONE
{
if (x_dnd_last_seen_window != None
&& x_dnd_last_protocol_version != -1)
- x_dnd_send_leave (f, x_dnd_last_seen_window);
+ x_dnd_send_leave (f, x_dnd_last_seen_window,
+ x_dnd_last_seen_toplevel);
else if (x_dnd_last_seen_window != None
&& !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style)
&& x_dnd_last_motif_style != XM_DRAG_STYLE_NONE
if (x_dnd_last_seen_window != None
&& x_dnd_last_protocol_version != -1
&& x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))
- x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window);
+ x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window,
+ x_dnd_last_seen_toplevel);
else if (x_dnd_last_seen_window != None
&& XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style)
&& !x_dnd_disable_motif_drag
if (x_dnd_last_seen_window != None
&& x_dnd_last_protocol_version != -1
&& x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))
- x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window);
+ x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window,
+ x_dnd_last_seen_toplevel);
else if (x_dnd_last_seen_window != None
&& XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style)
&& !x_dnd_disable_motif_drag
x_dnd_last_window_is_frame = was_frame;
if (target != None && x_dnd_last_protocol_version != -1)
- x_dnd_send_enter (x_dnd_frame, target,
+ x_dnd_send_enter (x_dnd_frame, target, x_dnd_last_seen_toplevel,
x_dnd_last_protocol_version);
else if (target != None && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style)
&& !x_dnd_disable_motif_drag)
x_dnd_note_self_position (dpyinfo, target, root_x, root_y);
else if (x_dnd_last_protocol_version != -1 && target != None)
x_dnd_send_position (x_dnd_frame, target,
+ x_dnd_last_seen_toplevel,
x_dnd_last_protocol_version,
root_x, root_y,
x_dnd_selection_timestamp,
if (x_dnd_last_seen_window != None
&& x_dnd_last_protocol_version != -1)
x_dnd_send_leave (x_dnd_frame,
- x_dnd_last_seen_window);
+ x_dnd_last_seen_window,
+ x_dnd_last_seen_toplevel);
else if (x_dnd_last_seen_window != None
&& !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style)
&& x_dnd_last_motif_style != XM_DRAG_STYLE_NONE
x_dnd_waiting_for_finish
= x_dnd_send_drop (x_dnd_finish_frame,
- target, x_dnd_selection_timestamp,
+ target,
+ x_dnd_last_seen_toplevel,
+ x_dnd_selection_timestamp,
x_dnd_send_drop_proto);
}
}
if (x_dnd_last_seen_window != None
&& x_dnd_last_protocol_version != -1
&& x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))
- x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window);
+ x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window,
+ x_dnd_last_seen_toplevel);
else if (x_dnd_last_seen_window != None
&& XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style)
&& !x_dnd_disable_motif_drag
if (x_dnd_last_seen_window != None
&& x_dnd_last_protocol_version != -1
&& x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))
- x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window);
+ x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window,
+ x_dnd_last_seen_toplevel);
else if (x_dnd_last_seen_window != None
&& XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style)
&& x_dnd_disable_motif_drag
if (target != None && x_dnd_last_protocol_version != -1)
x_dnd_send_enter (x_dnd_frame, target,
+ x_dnd_last_seen_toplevel,
x_dnd_last_protocol_version);
else if (target != None && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style)
&& !x_dnd_disable_motif_drag)
event->xbutton.y_root);
else if (x_dnd_last_protocol_version != -1 && target != None)
x_dnd_send_position (x_dnd_frame, target,
+ x_dnd_last_seen_toplevel,
x_dnd_last_protocol_version,
event->xmotion.x_root,
event->xmotion.y_root,
else if (x_dnd_last_protocol_version != -1)
x_dnd_send_position (x_dnd_frame,
x_dnd_last_seen_window,
+ x_dnd_last_seen_toplevel,
x_dnd_last_protocol_version,
event->xbutton.x_root,
event->xbutton.y_root,
x_dnd_waiting_for_finish
= x_dnd_do_drop (x_dnd_last_seen_window,
+ x_dnd_last_seen_toplevel,
x_dnd_last_protocol_version);
x_dnd_finish_display = dpyinfo->display;
}
if (x_dnd_last_seen_window != None
&& x_dnd_last_protocol_version != -1
&& x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))
- x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window);
+ x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window,
+ x_dnd_last_seen_toplevel);
else if (x_dnd_last_seen_window != None
&& XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style)
&& !x_dnd_disable_motif_drag
if (x_dnd_last_seen_window != None
&& x_dnd_last_protocol_version != -1
&& x_dnd_last_seen_window != FRAME_OUTER_WINDOW (x_dnd_frame))
- x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window);
+ x_dnd_send_leave (x_dnd_frame, x_dnd_last_seen_window,
+ x_dnd_last_seen_toplevel);
else if (x_dnd_last_seen_window != None
&& XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style)
&& !x_dnd_disable_motif_drag
if (target != None && x_dnd_last_protocol_version != -1)
x_dnd_send_enter (x_dnd_frame, target,
+ x_dnd_last_seen_toplevel,
x_dnd_last_protocol_version);
else if (target != None && XM_DRAG_STYLE_IS_DYNAMIC (x_dnd_last_motif_style)
&& !x_dnd_disable_motif_drag)
dnd_state = xi_convert_event_state (xev);
x_dnd_send_position (x_dnd_frame, target,
+ x_dnd_last_seen_toplevel,
x_dnd_last_protocol_version,
lrint (xev->root_x),
lrint (xev->root_y),
else
x_dnd_send_position (x_dnd_frame,
x_dnd_last_seen_window,
+ x_dnd_last_seen_toplevel,
x_dnd_last_protocol_version,
lrint (xev->root_x),
lrint (xev->root_y),
x_dnd_waiting_for_finish
= x_dnd_do_drop (x_dnd_last_seen_window,
+ x_dnd_last_seen_toplevel,
x_dnd_last_protocol_version);
x_dnd_finish_display = dpyinfo->display;
}
if (x_dnd_last_seen_window != None
&& x_dnd_last_protocol_version != -1)
x_dnd_send_leave (x_dnd_frame,
- x_dnd_last_seen_window);
+ x_dnd_last_seen_window,
+ x_dnd_last_seen_toplevel);
else if (x_dnd_last_seen_window != None
&& !XM_DRAG_STYLE_IS_DROP_ONLY (x_dnd_last_motif_style)
&& x_dnd_last_motif_style != XM_DRAG_STYLE_NONE