summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2016-10-19 13:43:38 +0200
committerOlivier Fourdan <ofourdan@redhat.com>2016-10-27 17:27:35 +0200
commit5919a4a779f7882d5f967bf1359e476d6ef28f67 (patch)
treea635db4c72e11144ea54f3c4a0c06d2789198a5e
parente8fc09064afd8b1d50ff401140c412db558a2d62 (diff)
downloadmutter-5919a4a779f7882d5f967bf1359e476d6ef28f67.tar.gz
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
-rw-r--r--src/core/window.c22
1 files changed, 1 insertions, 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)