From a7fff3699131d82a448d8808205c4359f05aa388 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sun, 10 Jul 2022 20:05:23 +0800 Subject: [PATCH] Minor fixes to WM_DELETE_WINDOW handling * src/xterm.c (handle_one_xevent): Only handle WM_DELETE_WINDOW to toplevel windows, and set event timestamp. --- src/xterm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xterm.c b/src/xterm.c index e7e6ca7bf88..ac4e210786e 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -16593,11 +16593,14 @@ handle_one_xevent (struct x_display_info *dpyinfo, if (event->xclient.data.l[0] == dpyinfo->Xatom_wm_delete_window) { - f = any; + f = x_top_window_to_frame (dpyinfo, + event->xclient.window); + if (!f) goto OTHER; /* May be a dialog that is to be removed */ inev.ie.kind = DELETE_WINDOW_EVENT; + inev.ie.timestamp = event->xclient.data.l[1]; XSETFRAME (inev.ie.frame_or_window, f); goto done; } -- 2.39.5