From eb789e43e317fbb25fbd1f51d0edf9800f8c002a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Wed, 13 May 2015 23:35:37 +0200 Subject: [PATCH] Show Desktop: activateNextClient prefers desktop othrwise closing a keepabove or desktop group window would activate some random window and break the state as a side-effect REVIEW: 123783 CCBUG: 346837 CCBUG: 346933 CCBUG: 347212 --- activation.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/activation.cpp b/activation.cpp index fe0a51fa83..a2cc05c821 100644 --- a/activation.cpp +++ b/activation.cpp @@ -463,6 +463,11 @@ bool Workspace::activateNextClient(Client* c) get_focus = NULL; } + const int desktop = VirtualDesktopManager::self()->current(); + + if (!get_focus && showingDesktop()) + get_focus = findDesktop(true, desktop); // to not break the state + if (!get_focus && options->isNextFocusPrefersMouse()) { get_focus = clientUnderMouse(c ? c->screen() : screens()->current()); if (get_focus && (get_focus == c || get_focus->isDesktop())) { @@ -471,8 +476,6 @@ bool Workspace::activateNextClient(Client* c) } } - const int desktop = VirtualDesktopManager::self()->current(); - if (!get_focus) { // no suitable window under the mouse -> find sth. else // first try to pass the focus to the (former) active clients leader if (c && (get_focus = c->transientFor()) && FocusChain::self()->isUsableFocusCandidate(get_focus, c)) {