summaryrefslogtreecommitdiff
path: root/lisp/avoid.el
diff options
context:
space:
mode:
authorMartin Rudalics <rudalics@gmx.at>2019-08-04 09:21:18 +0200
committerMartin Rudalics <rudalics@gmx.at>2019-08-04 09:21:18 +0200
commit5ec3f70527e330abf4c0c3519fa4914c5f094358 (patch)
tree3e91fb7a326694d8b46cf9f1ed4e548ce4f7f19d /lisp/avoid.el
parent01661f33c11654d1fe5fe1013332db2500b7f449 (diff)
downloademacs-5ec3f70527e330abf4c0c3519fa4914c5f094358.tar.gz
emacs-5ec3f70527e330abf4c0c3519fa4914c5f094358.tar.bz2
emacs-5ec3f70527e330abf4c0c3519fa4914c5f094358.zip
Fix two mouse drag and drop issues (Bug#28620, Bug#36269)
Allow 'mouse-drag-and-drop-region' to move/copy text from one frame to another (Bug#28620). Prevent mouse avoidance mode from interfering with 'mouse-drag-and-drop-region' (Bug#36269). * lisp/avoid.el (mouse-avoidance-ignore-p): Suspend avoidance when 'track-mouse' equals 'dropping'. * lisp/mouse.el (mouse-drag-and-drop-region): Set 'track-mouse' to 'dropping'. Continue reading events also when switching frames. * src/keyboard.c (Finternal_track_mouse): Rename from Ftrack_mouse. (some_mouse_moved): Return NULL also when mouse is not tracked. (show_help_echo, readable_events, kbd_buffer_get_event): Don't check whether mouse is tracked, some_mouse_moved does it now. (track_mouse): Rename variable from do_mouse_tracking. Adjust all users. In doc-string explain meanings of special values 'dragging' and 'dropping'. * src/nsterm.m (ns_mouse_position): During drag and drop consider last mouse frame only when there is no currently focused frame. * src/w32fns.c (w32_wnd_proc): Don't set mouse capture during a drag and drop operation. * src/w32term.c (w32_mouse_position): Track frame under mouse during mouse drag and drop. (mouse_or_wdesc_frame): New function. (w32_read_socket): Call mouse_or_wdesc_frame on mouse events. * src/xdisp.c (define_frame_cursor1): Don't change mouse cursor shape during mouse drag and drop. (syms_of_xdisp): New symbol Qdropping. * src/xterm.c (XTmouse_position): Allow mouse drag and drop move to another frame (mouse_or_wdesc_frame): New function. (handle_one_xevent): Use mouse_or_wdesc_frame for mouse events.
Diffstat (limited to 'lisp/avoid.el')
-rw-r--r--lisp/avoid.el3
1 files changed, 3 insertions, 0 deletions
diff --git a/lisp/avoid.el b/lisp/avoid.el
index 7d69fa2a247..43e5062b76c 100644
--- a/lisp/avoid.el
+++ b/lisp/avoid.el
@@ -327,6 +327,9 @@ redefine this function to suit your own tastes."
executing-kbd-macro ; don't check inside macro
(null (cadr mp)) ; don't move unless in an Emacs frame
(not (eq (car mp) (selected-frame)))
+ ;; Don't interfere with ongoing `mouse-drag-and-drop-region'
+ ;; (Bug#36269).
+ (eq track-mouse 'dropping)
;; Don't do anything if last event was a mouse event.
;; FIXME: this code fails in the case where the mouse was moved
;; since the last key-press but without generating any event.