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
This commit is contained in:
Olivier Fourdan 2016-10-19 13:43:38 +02:00
parent d491063110
commit 998d921d41

View File

@ -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)