From ce1f7f2467a59924134a89f61debd5a0a59a73ea Mon Sep 17 00:00:00 2001 From: Po Lu Date: Thu, 31 Mar 2022 18:52:01 +0800 Subject: [PATCH] Minor fixes to treatment of `allow_current_frame' * src/xterm.c (x_dnd_send_drop): Don't send special event for wrong frame. (x_dnd_send_drop): Fix condition for returning XdndActionPrivate. --- src/xterm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xterm.c b/src/xterm.c index 6a19828a36a..81b84c8609c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -2502,6 +2502,10 @@ x_dnd_send_drop (struct frame *f, Window target, Time timestamp, if (self_frame) { + if (!x_dnd_allow_current_frame + && self_frame == x_dnd_frame) + return false; + /* Send a special drag-and-drop event when dropping on top of an Emacs frame to avoid all the overhead involved with sending client events. */ @@ -8625,7 +8629,7 @@ x_dnd_begin_drag_and_drop (struct frame *f, Time time, Atom xaction, if (x_dnd_end_window != None && (any = x_any_window_to_frame (FRAME_DISPLAY_INFO (f), x_dnd_end_window)) - && (any != f)) + && (allow_current_frame || any != f)) return QXdndActionPrivate; if (x_dnd_action != None) -- 2.39.2