diff options
| author | Po Lu | 2022-08-13 10:35:08 +0800 |
|---|---|---|
| committer | Po Lu | 2022-08-13 10:35:08 +0800 |
| commit | e311d05ab100b5518b974ccaee148a35ae2dada0 (patch) | |
| tree | 2ad97693b31ef5be5d13288ebeeb2143b7334ed0 /src/xfns.c | |
| parent | 37073492fdf382af2e642a4c80a9153891260374 (diff) | |
| download | emacs-e311d05ab100b5518b974ccaee148a35ae2dada0.tar.gz emacs-e311d05ab100b5518b974ccaee148a35ae2dada0.zip | |
Improve MPX interaction with drag-and-drop
* src/xfns.c (Fx_set_mouse_absolute_pixel_position): Use
internal client pointer record.
* src/xterm.c (x_dnd_cancel_dnd_early): New function. Only used
on XI2 builds so far.
(x_dnd_begin_drag_and_drop): Set the pointer device used for DND
events.
(xi_disable_devices): Cancel the drag-and-drop operation if that
device is disabled.
(x_send_scroll_bar_event): Update outdated comment.
(handle_one_xevent): Only accept DND events from that device.
(frame_set_mouse_pixel_position): Use internal client pointer
record.
Diffstat (limited to 'src/xfns.c')
| -rw-r--r-- | src/xfns.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/xfns.c b/src/xfns.c index 2845ecca6a9..144f64f6f62 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -6851,17 +6851,16 @@ The coordinates X and Y are interpreted in pixels relative to a position | |||
| 6851 | #ifdef HAVE_XINPUT2 | 6851 | #ifdef HAVE_XINPUT2 |
| 6852 | int deviceid; | 6852 | int deviceid; |
| 6853 | 6853 | ||
| 6854 | if (FRAME_DISPLAY_INFO (f)->supports_xi2) | 6854 | deviceid = FRAME_DISPLAY_INFO (f)->client_pointer_device; |
| 6855 | |||
| 6856 | if (FRAME_DISPLAY_INFO (f)->supports_xi2 | ||
| 6857 | && deviceid != -1) | ||
| 6855 | { | 6858 | { |
| 6856 | XGrabServer (FRAME_X_DISPLAY (f)); | 6859 | x_catch_errors_for_lisp (FRAME_X_DISPLAY (f)); |
| 6857 | if (XIGetClientPointer (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 6860 | XIWarpPointer (FRAME_X_DISPLAY (f), deviceid, None, |
| 6858 | &deviceid)) | 6861 | FRAME_DISPLAY_INFO (f)->root_window, |
| 6859 | { | 6862 | 0, 0, 0, 0, xval, yval); |
| 6860 | XIWarpPointer (FRAME_X_DISPLAY (f), deviceid, None, | 6863 | x_uncatch_errors_for_lisp (FRAME_X_DISPLAY (f)); |
| 6861 | FRAME_DISPLAY_INFO (f)->root_window, | ||
| 6862 | 0, 0, 0, 0, xval, yval); | ||
| 6863 | } | ||
| 6864 | XUngrabServer (FRAME_X_DISPLAY (f)); | ||
| 6865 | } | 6864 | } |
| 6866 | else | 6865 | else |
| 6867 | #endif | 6866 | #endif |