mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 11:32:04 +00:00
window: Avoid spurious focus-window changes when showing desktop
When using the show-desktop shortcut with no desktop window, unshowing
will focus the second-most-recently-used window. If we find a desktop
window, it will be focused explicitly and everything works as expected;
however without a desktop window, we end up hiding the focus window,
which will use focus_default_window() with the not_this_one parameter
to move focus away. We used to get away with this, as the not_this_one
parameter was ignored until commit e257580b94
, now with bug 675982
fixed, we need to explicitly handle the show-desktop case.
https://bugzilla.gnome.org/show_bug.cgi?id=686928
This commit is contained in:
parent
e2bf91cd61
commit
2cc0d31b17
@ -3304,8 +3304,11 @@ meta_window_hide (MetaWindow *window)
|
||||
* active workspace; when it is not, we need to pass in NULL, so as to
|
||||
* focus the default window for the active workspace (this scenario
|
||||
* arises when we are switching workspaces).
|
||||
* We also pass in NULL if we are in the process of hiding all non-desktop
|
||||
* windows to avoid unexpected changes to the stacking order.
|
||||
*/
|
||||
if (my_workspace == window->screen->active_workspace)
|
||||
if (my_workspace == window->screen->active_workspace &&
|
||||
!my_workspace->showing_desktop)
|
||||
not_this_one = window;
|
||||
|
||||
meta_workspace_focus_default_window (window->screen->active_workspace,
|
||||
|
Loading…
Reference in New Issue
Block a user