Commit ee6e4bc5 authored by Po Lu's avatar Po Lu
Browse files

Update device-specific grab during drag-and-drop

* src/xterm.c (x_detect_focus_change): Fix typo.
(handle_one_xevent): Set device if DND is in progress and update
device->grab.
parent 2bf96389
Pipeline #18735 passed with stages
in 33 minutes and 55 seconds
......@@ -11928,8 +11928,8 @@ x_detect_focus_change (struct x_display_info *dpyinfo, struct frame *frame,
really has focus, and these kinds of focus event don't
correspond to real user input changes. GTK+ uses the same
filtering. */
if (event->xfocus.mode == NotifyGrab ||
event->xfocus.mode == NotifyUngrab)
if (event->xfocus.mode == NotifyGrab
|| event->xfocus.mode == NotifyUngrab)
return;
x_focus_changed (event->type,
(event->xfocus.detail == NotifyPointer ?
......@@ -20081,6 +20081,7 @@ handle_one_xevent (struct x_display_info *dpyinfo,
&& dpyinfo == FRAME_DISPLAY_INFO (x_dnd_frame))
{
f = mouse_or_wdesc_frame (dpyinfo, xev->event);
device = xi_device_from_id (dpyinfo, xev->deviceid);
 
/* Don't track grab status for emulated pointer
events, because they are ignored by the regular
......@@ -20096,6 +20097,10 @@ handle_one_xevent (struct x_display_info *dpyinfo,
 
dpyinfo->grabbed |= (1 << xev->detail);
dpyinfo->last_mouse_frame = f;
if (device)
device->grab |= (1 << xev->detail);
if (f && !tab_bar_p)
f->last_tab_bar_item = -1;
#if ! defined (USE_GTK)
......@@ -20104,7 +20109,10 @@ handle_one_xevent (struct x_display_info *dpyinfo,
#endif /* not USE_GTK */
}
else
dpyinfo->grabbed &= ~(1 << xev->detail);
{
dpyinfo->grabbed &= ~(1 << xev->detail);
device->grab &= ~(1 << xev->detail);
}
#ifdef XIPointerEmulated
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment