[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master ee6e4bc525: Update device-specific grab during drag-and-drop
From: |
Po Lu |
Subject: |
master ee6e4bc525: Update device-specific grab during drag-and-drop |
Date: |
Wed, 22 Jun 2022 20:54:06 -0400 (EDT) |
branch: master
commit ee6e4bc525125c77d284039c0ab2e2ce4d70c7e3
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
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.
---
src/xterm.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/xterm.c b/src/xterm.c
index cfe329ab0f..b6300f831f 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master ee6e4bc525: Update device-specific grab during drag-and-drop,
Po Lu <=