From e1178eb6405f8aa9196ecaede464707277a90afa Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sun, 20 Mar 2022 16:21:45 +0800 Subject: [PATCH] Make DND between frames work properly * src/xterm.c (handle_one_xevent): Don't wait for a finish event when dropping on top of another Emacs frame. --- src/xterm.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index 98888414d53..d094224952a 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -12429,7 +12429,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (x_dnd_last_seen_window != None && x_dnd_last_protocol_version != -1) { - x_dnd_waiting_for_finish = true; + /* Crazy hack to make dragging from one frame to + another work. */ + x_dnd_waiting_for_finish = !x_any_window_to_frame (dpyinfo, + x_dnd_last_seen_window); x_dnd_pending_finish_target = x_dnd_last_seen_window; x_dnd_waiting_for_finish_proto = x_dnd_last_protocol_version; @@ -13414,7 +13417,8 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (x_dnd_last_seen_window != None && x_dnd_last_protocol_version != -1) { - x_dnd_waiting_for_finish = true; + x_dnd_waiting_for_finish = !x_any_window_to_frame (dpyinfo, + x_dnd_last_seen_window); x_dnd_pending_finish_target = x_dnd_last_seen_window; x_dnd_waiting_for_finish_proto = x_dnd_last_protocol_version; -- 2.39.2