Skip to content

Commit f3fce78

Browse files
committed
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 GNOME/mutter@998d921#diff-029d285c3238fbe60d57f513265e1723
1 parent 97faaee commit f3fce78

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

src/core/window.c

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3040,27 +3040,7 @@ meta_window_show (MetaWindow *window)
30403040
( (!place_on_top_on_map && !takes_focus_on_map) ||
30413041
window_would_be_covered (window) )
30423042
) {
3043-
if (meta_window_is_ancestor_of_transient (focus_window, window))
3044-
{
3045-
guint32 timestamp;
3046-
3047-
timestamp = meta_display_get_current_time_roundtrip (window->display);
3048-
3049-
/* This happens for error dialogs or alerts; these need to remain on
3050-
* top, but it would be confusing to have its ancestor remain
3051-
* focused.
3052-
*/
3053-
meta_topic (META_DEBUG_STARTUP,
3054-
"The focus window %s is an ancestor of the newly mapped "
3055-
"window %s which isn't being focused. Unfocusing the "
3056-
"ancestor.\n",
3057-
focus_window->desc, window->desc);
3058-
3059-
meta_display_focus_the_no_focus_window (window->display,
3060-
window->screen,
3061-
timestamp);
3062-
}
3063-
else
3043+
if (!meta_window_is_ancestor_of_transient (focus_window, window))
30643044
{
30653045
needs_stacking_adjustment = TRUE;
30663046
if (!window->placed)

0 commit comments

Comments
 (0)