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)