emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 8aff4c0a36: Handle quitting correctly during interprogram drag-an


From: Po Lu
Subject: master 8aff4c0a36: Handle quitting correctly during interprogram drag-and-drop
Date: Tue, 22 Mar 2022 23:32:25 -0400 (EDT)

branch: master
commit 8aff4c0a366f060595dd6360e7a008585b7eb405
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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.
---
 lisp/mouse.el | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/lisp/mouse.el b/lisp/mouse.el
index 30b19510a4..381fc0c47e 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))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]