FRAME_DISPLAY_INFO (f)->grabbed = 0;
- if (x_dnd_wanted_action != None)
+ if (x_dnd_action != None)
{
block_input ();
atom_name = XGetAtomName (FRAME_X_DISPLAY (f),
- x_dnd_wanted_action);
+ x_dnd_action);
action = intern (atom_name);
XFree (atom_name);
unblock_input ();
x_dnd_return_frame = 3;
}
+ x_dnd_action = None;
x_dnd_last_seen_window = target;
x_dnd_last_protocol_version = target_proto;
if (x_dnd_last_protocol_version != -1 && target != None)
x_dnd_send_position (x_dnd_frame, target,
x_dnd_last_protocol_version,
- root_x, root_y, x_dnd_selection_timestamp,
- dpyinfo->Xatom_XdndActionCopy);
+ root_x, root_y,
+ x_dnd_selection_timestamp,
+ x_dnd_wanted_action);
}
/* The pointer moved out of the screen. */
else if (x_dnd_last_protocol_version)
if (event->xclient.data.l[1] & 1)
{
if (x_dnd_last_protocol_version >= 2)
- x_dnd_wanted_action = event->xclient.data.l[4];
+ x_dnd_action = event->xclient.data.l[4];
else
- x_dnd_wanted_action = dpyinfo->Xatom_XdndActionCopy;
+ x_dnd_action = dpyinfo->Xatom_XdndActionCopy;
}
else
- x_dnd_wanted_action = None;
+ x_dnd_action = None;
}
}
x_dnd_waiting_for_finish = false;
if (x_dnd_waiting_for_finish_proto >= 5)
- x_dnd_wanted_action = event->xclient.data.l[2];
+ x_dnd_action = event->xclient.data.l[2];
if (x_dnd_waiting_for_finish_proto >= 5
&& !(event->xclient.data.l[1] & 1))
- x_dnd_wanted_action = None;
+ x_dnd_action = None;
}
if (event->xclient.message_type == dpyinfo->Xatom_wm_protocols
clear_mouse_face (hlinfo);
}
+ f = mouse_or_wdesc_frame (dpyinfo, event->xmotion.window);
+
if (x_dnd_in_progress
&& dpyinfo == FRAME_DISPLAY_INFO (x_dnd_frame))
{
Window target;
int target_proto;
+ /* Sometimes the drag-and-drop operation starts with the
+ pointer of a frame invisible due to input. Since
+ motion events are ignored during that, make the pointer
+ visible manually. */
+
+ if (f)
+ XTtoggle_invisible_pointer (f, false);
+
target = x_dnd_get_target_window (dpyinfo,
event->xmotion.x_root,
event->xmotion.y_root,
x_dnd_return_frame = 3;
}
- x_dnd_wanted_action = None;
+ x_dnd_action = None;
x_dnd_last_seen_window = target;
x_dnd_last_protocol_version = target_proto;
event->xmotion.x_root,
event->xmotion.y_root,
x_dnd_selection_timestamp,
- dpyinfo->Xatom_XdndActionCopy);
+ x_dnd_wanted_action);
goto OTHER;
}
- f = mouse_or_wdesc_frame (dpyinfo, event->xmotion.window);
-
#ifdef USE_GTK
if (f && xg_event_is_for_scrollbar (f, event, false))
f = 0;
clear_mouse_face (hlinfo);
}
+ f = mouse_or_wdesc_frame (dpyinfo, xev->event);
+
if (x_dnd_in_progress
&& dpyinfo == FRAME_DISPLAY_INFO (x_dnd_frame))
{
Window target;
int target_proto;
+ /* Sometimes the drag-and-drop operation starts with the
+ pointer of a frame invisible due to input. Since
+ motion events are ignored during that, make the pointer
+ visible manually. */
+
+ if (f)
+ XTtoggle_invisible_pointer (f, false);
+
target = x_dnd_get_target_window (dpyinfo,
xev->root_x,
xev->root_y,
x_dnd_return_frame = 3;
}
+ x_dnd_action = None;
x_dnd_last_seen_window = target;
x_dnd_last_protocol_version = target_proto;
x_dnd_last_protocol_version,
xev->root_x, xev->root_y,
x_dnd_selection_timestamp,
- dpyinfo->Xatom_XdndActionCopy);
+ x_dnd_wanted_action);
goto XI_OTHER;
}
- f = mouse_or_wdesc_frame (dpyinfo, xev->event);
-
#ifdef USE_GTK
if (f && xg_event_is_for_scrollbar (f, event, false))
f = 0;