summaryrefslogtreecommitdiff
path: root/lisp/mouse.el
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-03-23 11:30:13 +0800
committerPo Lu <luangruo@yahoo.com>2022-03-23 11:30:13 +0800
commit8aff4c0a366f060595dd6360e7a008585b7eb405 (patch)
tree93bdf734c314dbd21baec6b494b309b70b31fee7 /lisp/mouse.el
parent021dbdb1287de0f5502eac00fee8d43b8d22db55 (diff)
downloademacs-8aff4c0a366f060595dd6360e7a008585b7eb405.tar.gz
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.
Diffstat (limited to 'lisp/mouse.el')
-rw-r--r--lisp/mouse.el16
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el
index 30b19510a46..381fc0c47e8 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -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))