1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-27 08:43:40 -07:00

Handle quitting correctly during interprogram drag-and-drop

* lisp/mouse.el (mouse-drag-and-drop-region): Handle quit
correctly by exiting the cross program drag and drop.
This commit is contained in:
Po Lu 2022-03-23 11:30:13 +08:00
parent 021dbdb128
commit 8aff4c0a36

View file

@ -3119,13 +3119,15 @@ is copied instead of being cut."
(mouse-drag-and-drop-region-hide-tooltip)
(gui-set-selection 'XdndSelection value-selection)
(let ((drag-action-or-frame
(x-begin-drag '("UTF8_STRING" "text/plain"
"text/plain;charset=utf-8"
"STRING" "TEXT" "COMPOUND_TEXT")
(if mouse-drag-and-drop-region-cut-when-buffers-differ
'XdndActionMove
'XdndActionCopy)
(posn-window (event-end event)) t)))
(condition-case nil
(x-begin-drag '("UTF8_STRING" "text/plain"
"text/plain;charset=utf-8"
"STRING" "TEXT" "COMPOUND_TEXT")
(if mouse-drag-and-drop-region-cut-when-buffers-differ
'XdndActionMove
'XdndActionCopy)
(posn-window (event-end event)) t)
(quit nil))))
(when (framep drag-action-or-frame)
(throw 'drag-again nil))