summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-03-17 17:41:41 +0800
committerPo Lu <luangruo@yahoo.com>2022-03-17 17:41:41 +0800
commit140d7cc9cbb9da0a2494110105909b1cb8c92998 (patch)
treed6b8924ec99d0d3ef561dc04b074e4046ef7fe38
parent51bf066b30131c8bcbc0592f1b7363bcecfee334 (diff)
downloademacs-140d7cc9cbb9da0a2494110105909b1cb8c92998.tar.gz
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.
-rw-r--r--src/xterm.c3
1 files changed, 3 insertions, 0 deletions
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");