From 94ecd2b3c664387cd703fb639d6909a9e6bf551b Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 30 Apr 2022 08:47:42 +0800 Subject: [PATCH] Check display when handling XdndFinished events * src/xterm.c (handle_one_xevent): Check that the display is actually the one we want before finishing DND. --- src/xterm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/xterm.c b/src/xterm.c index 51828795c5f..28c435afde3 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -14077,6 +14077,10 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (event->xclient.message_type == dpyinfo->Xatom_XdndFinished && (x_dnd_waiting_for_finish && !x_dnd_waiting_for_motif_finish) + /* Also check that the display is correct, since + `x_dnd_pending_finish_target' could still be valid on + another X server. */ + && dpyinfo->display == x_dnd_finish_display && event->xclient.data.l[0] == x_dnd_pending_finish_target) { x_dnd_waiting_for_finish = false; -- 2.39.2