From f7eec293a6e3b6a1c34fb2552d4439fee5d47e42 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 17 Sep 2022 16:46:26 +0800 Subject: [PATCH] Fix MPX focus tracking upon frame deletion * src/xterm.c (x_free_frame_resources): Consider focus change after. --- src/xterm.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/xterm.c b/src/xterm.c index 8c41f14864a..deceafbc817 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -27354,6 +27354,16 @@ x_free_frame_resources (struct frame *f) if (f == hlinfo->mouse_face_mouse_frame) reset_mouse_highlight (hlinfo); +#ifdef HAVE_XINPUT2 + /* Consider a frame being unfocused with no following FocusIn event + while an older focus from another seat exists. The client + pointer should then revert to the other seat, so handle potential + focus changes. */ + + if (dpyinfo->supports_xi2) + xi_handle_focus_change (dpyinfo); +#endif + unblock_input (); } -- 2.39.2