1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-03-12 18:01:46 -07:00

Ignore emulated mouse clicks during drag-and-drop

* src/xterm.c (handle_one_xevent): Don't set dpyinfo->grab and
last mouse frame for emulated mouse events during a
drag-and-drop operation.
This commit is contained in:
Po Lu 2022-06-19 15:21:46 +08:00
parent 823b503c9d
commit 76f3878e28

View file

@ -20050,19 +20050,29 @@ handle_one_xevent (struct x_display_info *dpyinfo,
{
f = mouse_or_wdesc_frame (dpyinfo, xev->event);
if (xev->evtype == XI_ButtonPress)
/* Don't track grab status for emulated pointer
events, because they are ignored by the regular
mouse click processing code. */
#ifdef XIPointerEmulated
if (!(xev->flags & XIPointerEmulated))
{
dpyinfo->grabbed |= (1 << xev->detail);
dpyinfo->last_mouse_frame = f;
if (f && !tab_bar_p)
f->last_tab_bar_item = -1;
#endif
if (xev->evtype == XI_ButtonPress)
{
dpyinfo->grabbed |= (1 << xev->detail);
dpyinfo->last_mouse_frame = f;
if (f && !tab_bar_p)
f->last_tab_bar_item = -1;
#if ! defined (USE_GTK)
if (f && !tool_bar_p)
f->last_tool_bar_item = -1;
if (f && !tool_bar_p)
f->last_tool_bar_item = -1;
#endif /* not USE_GTK */
}
else
dpyinfo->grabbed &= ~(1 << xev->detail);
#ifdef XIPointerEmulated
}
else
dpyinfo->grabbed &= ~(1 << xev->detail);
#endif
if (xev->evtype == XI_ButtonPress
&& x_dnd_last_seen_window != None