From 998d921d418a7e943ea16c02657588f868d50c91 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 19 Oct 2016 13:43:38 +0200 Subject: [PATCH] window: Do not unfocus on new window mutter would remove focus from a toplevel when showing one of its transient window which is not on top and not focused. When using xdg_popup without grab as allowed in xdg_shell v6, the popup wouldn't be focused, and if an intermediate event occurs before the popup is shown, it's not placed on top either, which could randomly trigger a loss of focus in the corresponding toplevel window. Remove that special case, it doesn't make much sense to globally unset focus when mapping a new window. https://bugzilla.gnome.org/show_bug.cgi?id=773210 --- src/core/window.c | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/src/core/window.c b/src/core/window.c index 458e2d7b0..e3e15cf26 100644 --- a/src/core/window.c +++ b/src/core/window.c @@ -2267,27 +2267,7 @@ meta_window_show (MetaWindow *window) ( (!place_on_top_on_map && !takes_focus_on_map) || window_would_be_covered (window) ) ) { - if (meta_window_is_ancestor_of_transient (focus_window, window)) - { - guint32 timestamp; - - timestamp = meta_display_get_current_time_roundtrip (window->display); - - /* This happens for error dialogs or alerts; these need to remain on - * top, but it would be confusing to have its ancestor remain - * focused. - */ - meta_topic (META_DEBUG_STARTUP, - "The focus window %s is an ancestor of the newly mapped " - "window %s which isn't being focused. Unfocusing the " - "ancestor.\n", - focus_window->desc, window->desc); - - meta_display_focus_the_no_focus_window (window->display, - window->screen, - timestamp); - } - else + if (!meta_window_is_ancestor_of_transient (focus_window, window)) { needs_stacking_adjustment = TRUE; if (!window->placed)