diff options
| author | Po Lu | 2022-06-23 08:53:55 +0800 |
|---|---|---|
| committer | Po Lu | 2022-06-23 08:53:55 +0800 |
| commit | ee6e4bc525125c77d284039c0ab2e2ce4d70c7e3 (patch) | |
| tree | 820ff139963ebc00a1c024bedc008b7dc43d2139 /src | |
| parent | 2bf96389f7e28a2a0ba74606e84fc0aafd3009e6 (diff) | |
| download | emacs-ee6e4bc525125c77d284039c0ab2e2ce4d70c7e3.tar.gz emacs-ee6e4bc525125c77d284039c0ab2e2ce4d70c7e3.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/xterm.c b/src/xterm.c index cfe329ab0f7..b6300f831fd 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, | |||
| 11928 | really has focus, and these kinds of focus event don't | 11928 | really has focus, and these kinds of focus event don't |
| 11929 | correspond to real user input changes. GTK+ uses the same | 11929 | correspond to real user input changes. GTK+ uses the same |
| 11930 | filtering. */ | 11930 | filtering. */ |
| 11931 | if (event->xfocus.mode == NotifyGrab || | 11931 | if (event->xfocus.mode == NotifyGrab |
| 11932 | event->xfocus.mode == NotifyUngrab) | 11932 | || event->xfocus.mode == NotifyUngrab) |
| 11933 | return; | 11933 | return; |
| 11934 | x_focus_changed (event->type, | 11934 | x_focus_changed (event->type, |
| 11935 | (event->xfocus.detail == NotifyPointer ? | 11935 | (event->xfocus.detail == NotifyPointer ? |
| @@ -20081,6 +20081,7 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 20081 | && dpyinfo == FRAME_DISPLAY_INFO (x_dnd_frame)) | 20081 | && dpyinfo == FRAME_DISPLAY_INFO (x_dnd_frame)) |
| 20082 | { | 20082 | { |
| 20083 | f = mouse_or_wdesc_frame (dpyinfo, xev->event); | 20083 | f = mouse_or_wdesc_frame (dpyinfo, xev->event); |
| 20084 | device = xi_device_from_id (dpyinfo, xev->deviceid); | ||
| 20084 | 20085 | ||
| 20085 | /* Don't track grab status for emulated pointer | 20086 | /* Don't track grab status for emulated pointer |
| 20086 | events, because they are ignored by the regular | 20087 | events, because they are ignored by the regular |
| @@ -20096,6 +20097,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 20096 | 20097 | ||
| 20097 | dpyinfo->grabbed |= (1 << xev->detail); | 20098 | dpyinfo->grabbed |= (1 << xev->detail); |
| 20098 | dpyinfo->last_mouse_frame = f; | 20099 | dpyinfo->last_mouse_frame = f; |
| 20100 | |||
| 20101 | if (device) | ||
| 20102 | device->grab |= (1 << xev->detail); | ||
| 20103 | |||
| 20099 | if (f && !tab_bar_p) | 20104 | if (f && !tab_bar_p) |
| 20100 | f->last_tab_bar_item = -1; | 20105 | f->last_tab_bar_item = -1; |
| 20101 | #if ! defined (USE_GTK) | 20106 | #if ! defined (USE_GTK) |
| @@ -20104,7 +20109,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 20104 | #endif /* not USE_GTK */ | 20109 | #endif /* not USE_GTK */ |
| 20105 | } | 20110 | } |
| 20106 | else | 20111 | else |
| 20107 | dpyinfo->grabbed &= ~(1 << xev->detail); | 20112 | { |
| 20113 | dpyinfo->grabbed &= ~(1 << xev->detail); | ||
| 20114 | device->grab &= ~(1 << xev->detail); | ||
| 20115 | } | ||
| 20108 | #ifdef XIPointerEmulated | 20116 | #ifdef XIPointerEmulated |
| 20109 | } | 20117 | } |
| 20110 | #endif | 20118 | #endif |