From db228e276fd4e7e7b33957d96cba73aaa4166a8d Mon Sep 17 00:00:00 2001 From: Balazs Endresz Date: Tue, 1 Nov 2022 18:15:22 +0100 Subject: Always bring into foreground the previous window after closing one When opening and then closing certain applications the focus was correctly regained by the previous window but it wasn't brought into the foreground. To fix this we call meta_workspace_focus_default_window() for both NotifyDetailNone and NotifyPointerRoot. These two are always mentioned together in the X docs: https://tronche.com/gui/x/xlib/events/input-focus/normal-and-grabbed.html Some programs will have NotifyDetailNone when closed, while others end up with NotifyPointerRoot. --- src/core/display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/display.c b/src/core/display.c index 6af38087..f470ca5a 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -2223,7 +2223,7 @@ static gboolean event_callback(XEvent* event, gpointer data) meta_event_detail_to_string (event->xfocus.detail)); if (event->type == FocusIn && - event->xfocus.detail == NotifyDetailNone) + (event->xfocus.detail == NotifyDetailNone || event->xfocus.detail == NotifyPointerRoot)) { meta_topic (META_DEBUG_FOCUS, "Focus got set to None, probably due to " -- cgit v1.2.1