summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBalazs Endresz <[email protected]>2022-11-01 18:15:22 +0100
committerLuke from DC <[email protected]>2022-11-07 08:47:41 +0000
commitdb228e276fd4e7e7b33957d96cba73aaa4166a8d (patch)
tree076bc6c8c109e037dc88650bbdeeabcddf93641c
parentaf731228414c8413dd2666eb5e9e369544dd2886 (diff)
downloadmarco-db228e276fd4e7e7b33957d96cba73aaa4166a8d.tar.bz2
marco-db228e276fd4e7e7b33957d96cba73aaa4166a8d.tar.xz
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.
-rw-r--r--src/core/display.c2
1 files changed, 1 insertions, 1 deletions
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 "