From: Po Lu Date: Mon, 6 Jun 2022 04:48:40 +0000 (+0800) Subject: Signal an error XdndSelection was lost during drag-and-drop X-Git-Tag: emacs-29.0.90~1910^2~199 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=31bc62b6adeee5aa1539b1b527f52b85ea153d26;p=emacs.git 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. --- diff --git a/src/xselect.c b/src/xselect.c index 6e693c25884..b920540620b 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); }