From 140d7cc9cbb9da0a2494110105909b1cb8c92998 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 17 Mar 2022 17:41:41 +0800 Subject: [PATCH] Prevent invisible frames from acting as drag sources * src/xterm.c (x_dnd_begin_drag_and_drop): Error out if f is invisible. It makes no sense for an invisible frame to be a drag source, so the function just hangs. --- src/xterm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/xterm.c b/src/xterm.c index 1b0b3ef793f..6485374e2ae 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1093,6 +1093,9 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, char *atom_name; Lisp_Object action, ltimestamp; + if (!FRAME_VISIBLE_P (f)) + error ("Frame is invisible"); + if (x_dnd_in_progress) error ("A drag-and-drop session is already in progress"); -- 2.39.2