diff options
author | Po Lu <luangruo@yahoo.com> | 2022-04-04 20:32:46 +0800 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-04-04 20:32:46 +0800 |
commit | 84cf3be6f77f61dd361acdb3683ab9d71e76c995 (patch) | |
tree | ccf6ea1ff0d6ac533f3665991f311750af99f738 /lisp/term/x-win.el | |
parent | 3d2531c12c54f9ab923603655016077450c23ab2 (diff) | |
download | emacs-84cf3be6f77f61dd361acdb3683ab9d71e76c995.tar.gz |
Handle mouse movement correctly during DND from one of our own frames
* lisp/dnd.el (dnd-handle-movement): Select the window specified
in posn.
* lisp/term/x-win.el (x-dnd-movement): New function.
(x-dnd-movement-function): Set it as the default.
* src/frame.c (delete_frame): Prevent deleting the drop source
frame.
* src/xterm.c (x_dnd_send_position): Set new mouse movement
flags if the target window is one of our own frames.
(x_dnd_begin_drag_and_drop): Call DND movement function whenever
appropriate.
(x_free_frame_resources): Remove useless code.
(syms_of_xterm): New defvar `x-dnd-movement-function'.
* src/xterm.h: Update prototypes.
Diffstat (limited to 'lisp/term/x-win.el')
-rw-r--r-- | lisp/term/x-win.el | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 9ae238661e0..f0b9b27f66b 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el @@ -85,6 +85,7 @@ (defvar x-selection-timeout) (defvar x-session-id) (defvar x-session-previous-id) +(defvar x-dnd-movement-function) (defun x-handle-no-bitmap-icon (_switch) (setq default-frame-alist (cons '(icon-type) default-frame-alist))) @@ -1576,6 +1577,13 @@ frames on all displays." (add-variable-watcher 'x-gtk-use-native-input #'x-gtk-use-native-input-watcher) +(defun x-dnd-movement (_frame position) + "Handle movement to POSITION during drag-and-drop." + (dnd-handle-movement position) + (redisplay)) + +(setq x-dnd-movement-function #'x-dnd-movement) + (provide 'x-win) (provide 'term/x-win) |