]> git.eshelyaron.com Git - emacs.git/commitdiff
Signal an error XdndSelection was lost during drag-and-drop
authorPo Lu <luangruo@yahoo.com>
Mon, 6 Jun 2022 04:48:40 +0000 (12:48 +0800)
committerPo Lu <luangruo@yahoo.com>
Mon, 6 Jun 2022 04:48:40 +0000 (12:48 +0800)
* src/xselect.c (x_handle_selection_clear): Signal an error if
ownership of XdndSelection was lost during drag-and-drop.

src/xselect.c

index 6e693c258843520260ab43463d80bb22c05e9da4..b920540620be4eda91faaed660c0753e81e78793 100644 (file)
@@ -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);
 }