From 476ca65295bfb3f0d90f535d9930250a13a8b323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Mon, 18 Mar 2013 17:26:34 +0100 Subject: [PATCH] Depend fs layer upon active state, not stackorder according to NETWM spec implementation notes suggests "focused windows having state _NET_WM_STATE_FULLSCREEN" to be on the highest layer. We'll also take the screen into account The user set stacking (being raised) is not considered by the spec note This behavior is also suggested by an old comment in activation.cpp, void Workspace::setActiveClient() BUG: 296076 CCBUG: 224600 REVIEW: 109572 FIXED-IN: 4.11 --- layers.cpp | 21 +++++---------------- workspace.cpp | 11 +++++++++-- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/layers.cpp b/layers.cpp index 93c243f72d..d01cba023b 100644 --- a/layers.cpp +++ b/layers.cpp @@ -868,22 +868,11 @@ bool Client::isActiveFullScreen() const if (!isFullScreen()) return false; -// const Client* ac = workspace()->mostRecentlyActivatedClient(); // instead of activeClient() - avoids flicker -// if (!ac) -// return false; -// not needed, for xinerama -> && ( ac == this || this->group() == ac->group()) - - // only raise fullscreen above docks if it's the topmost window in unconstrained stacking order, - // i.e. the window set to be topmost by the user (also includes transients of the fullscreen window) - const Client* top = workspace()->topClientOnDesktop(VirtualDesktopManager::self()->current(), screen(), true, false); - if (!top) - return false; - - // check whether we ... - if (top == this) - return true; - // ... or one of our transients is topmost - return rec_checkTransientOnTop(transients_list, top); + const Client* ac = workspace()->mostRecentlyActivatedClient(); // instead of activeClient() - avoids flicker + // according to NETWM spec implementation notes suggests + // "focused windows having state _NET_WM_STATE_FULLSCREEN" to be on the highest layer. + // we'll also take the screen into account + return ac && (ac == this || this->group() == ac->group() || ac->screen() != screen()); } } // namespace diff --git a/workspace.cpp b/workspace.cpp index 46c1034408..11b76cc273 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1577,6 +1577,15 @@ int Workspace::screenNumber(const QPoint& pos) const void Workspace::sendClientToScreen(Client* c, int screen) { screen = c->rules()->checkScreen(screen); + if (c->isActive()) { + active_screen = screen; + // might impact the layer of a fullscreen window + foreach (Client *cc, clientList()) { + if (cc->isFullScreen() && cc->screen() == screen) { + updateClientLayer(cc); + } + } + } if (c->screen() == screen) // Don't use isOnScreen(), that's true even when only partially return; GeometryUpdatesBlocker blocker(c); @@ -1602,8 +1611,6 @@ void Workspace::sendClientToScreen(Client* c, int screen) it != transients_stacking_order.constEnd(); ++it) sendClientToScreen(*it, screen); - if (c->isActive()) - active_screen = screen; } void Workspace::killWindowId(Window window_to_kill)