emacs-diffs
[Top][All Lists]
Advanced

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

master 31bc62b6ad: Signal an error XdndSelection was lost during drag-an


From: Po Lu
Subject: master 31bc62b6ad: Signal an error XdndSelection was lost during drag-and-drop
Date: Mon, 6 Jun 2022 00:49:18 -0400 (EDT)

branch: master
commit 31bc62b6adeee5aa1539b1b527f52b85ea153d26
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Signal an error XdndSelection was lost during drag-and-drop
    
    * src/xselect.c (x_handle_selection_clear): Signal an error if
    ownership of XdndSelection was lost during drag-and-drop.
---
 src/xselect.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/xselect.c b/src/xselect.c
index 6e693c2588..b920540620 100644
--- a/src/xselect.c
+++ b/src/xselect.c
@@ -928,6 +928,12 @@ x_handle_selection_clear (struct selection_input_event 
*event)
   /* Run the `x-lost-selection-functions' abnormal hook.  */
   CALLN (Frun_hook_with_args, Qx_lost_selection_functions, selection_symbol);
 
+  /* If Emacs lost ownership of XdndSelection during drag-and-drop,
+     there is no point in continuing the drag-and-drop session.  */
+  if (x_dnd_in_progress
+      && EQ (selection_symbol, QXdndSelection))
+    error ("Lost ownership of XdndSelection");
+
   redisplay_preserve_echo_area (20);
 }
 



reply via email to

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