diff --git a/src/abstract_client.cpp b/src/abstract_client.cpp index 598856803b..530ac41570 100644 --- a/src/abstract_client.cpp +++ b/src/abstract_client.cpp @@ -209,13 +209,13 @@ void AbstractClient::setActive(bool act) setShade(ShadeNormal); StackingUpdatesBlocker blocker(workspace()); - workspace()->updateClientLayer(this); // active windows may get different layer + updateLayer(); // active windows may get different layer auto mainclients = mainClients(); for (auto it = mainclients.constBegin(); it != mainclients.constEnd(); ++it) if ((*it)->isFullScreen()) // fullscreens go high even if their transient is active - workspace()->updateClientLayer(*it); + (*it)->updateLayer(); doSetActive(); emit activeChanged(); @@ -338,7 +338,7 @@ void AbstractClient::setKeepAbove(bool b) } m_keepAbove = b; doSetKeepAbove(); - workspace()->updateClientLayer(this); + updateLayer(); updateWindowRules(Rules::Above); emit keepAboveChanged(m_keepAbove); @@ -358,7 +358,7 @@ void AbstractClient::setKeepBelow(bool b) } m_keepBelow = b; doSetKeepBelow(); - workspace()->updateClientLayer(this); + updateLayer(); updateWindowRules(Rules::Below); emit keepBelowChanged(m_keepBelow); diff --git a/src/activation.cpp b/src/activation.cpp index e640344bbe..fee629c075 100644 --- a/src/activation.cpp +++ b/src/activation.cpp @@ -244,7 +244,7 @@ void Workspace::setActiveClient(AbstractClient* c) if (screens()->count() > 1) { for (auto it = m_allClients.begin(); it != m_allClients.end(); ++it) { if (*it != active_client && (*it)->layer() == ActiveLayer && (*it)->screen() == active_client->screen()) { - updateClientLayer(*it); + (*it)->updateLayer(); } } } diff --git a/src/layers.cpp b/src/layers.cpp index 27d4449f73..728cbf595a 100644 --- a/src/layers.cpp +++ b/src/layers.cpp @@ -52,10 +52,6 @@ see Workspace::constrainedStackingOrder(), they may also be in higher layers, but they should never be below their mainwindow. - When some client attribute changes (above/below flag, transiency...), - Workspace::updateClientLayer() should be called in order to make - sure it's moved to the appropriate layer QList if needed. - Currently the things that affect client in which layer a client belongs: KeepAbove/Keep Below flags, window type, fullscreen state and whether the client is active, mainclient (transiency). @@ -95,12 +91,6 @@ namespace KWin // Workspace //******************************* -void Workspace::updateClientLayer(AbstractClient* c) -{ - if (c) - c->updateLayer(); -} - void Workspace::updateStackingOrder(bool propagate_new_clients) { if (block_stacking_updates > 0) { diff --git a/src/workspace.cpp b/src/workspace.cpp index d4dc010006..dd5c742d4c 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -724,7 +724,7 @@ void Workspace::addClient(X11Client *c) addToStack(c); markXStackingOrderAsDirty(); updateClientArea(); // This cannot be in manage(), because the client got added only now - updateClientLayer(c); + c->updateLayer(); if (c->isDesktop()) { raiseClient(c); // If there's no active client, make this desktop the active one @@ -822,7 +822,7 @@ void Workspace::removeDeleted(Deleted* c) void Workspace::addShellClient(AbstractClient *client) { setupClientConnections(client); - updateClientLayer(client); + client->updateLayer(); if (client->isPlaceable()) { const QRect area = clientArea(PlacementArea, Screens::self()->current(), client->desktop()); @@ -851,7 +851,7 @@ void Workspace::addShellClient(AbstractClient *client) } updateTabbox(); connect(client, &AbstractClient::windowShown, this, [this, client] { - updateClientLayer(client); + client->updateLayer(); markXStackingOrderAsDirty(); updateStackingOrder(true); updateClientArea(); diff --git a/src/workspace.h b/src/workspace.h index 702f274216..0a4d7b2f03 100644 --- a/src/workspace.h +++ b/src/workspace.h @@ -196,7 +196,6 @@ public: void lowerClientRequest(AbstractClient* c); void restackClientUnderActive(AbstractClient*); void restack(AbstractClient *c, AbstractClient *under, bool force = false); - void updateClientLayer(AbstractClient* c); void raiseOrLowerClient(AbstractClient*); void resetUpdateToolWindowsTimer(); void restoreSessionStackingOrder(X11Client *c); diff --git a/src/x11client.cpp b/src/x11client.cpp index 0d0908e581..3620b6e12b 100644 --- a/src/x11client.cpp +++ b/src/x11client.cpp @@ -418,8 +418,7 @@ bool X11Client::manage(xcb_window_t w, bool isMapped) // Make sure that the input window is created before we update the stacking order updateInputWindow(); - - workspace()->updateClientLayer(this); + updateLayer(); SessionInfo* session = workspace()->takeSessionInfo(this); if (session) { @@ -2938,7 +2937,7 @@ void X11Client::setTransient(xcb_window_t new_transient_for_id) } // checkGroup() will check 'check_active_modal' setTransientFor(transient_for); checkGroup(nullptr, true); // force, because transiency has changed - workspace()->updateClientLayer(this); + updateLayer(); workspace()->resetUpdateToolWindowsTimer(); emit transientChanged(); } @@ -3377,7 +3376,7 @@ void X11Client::checkGroup(Group* set_group, bool force) old_group->deref(); // can be now deleted if empty checkGroupTransients(); checkActiveModal(); - workspace()->updateClientLayer(this); + updateLayer(); } // used by Workspace::findClientLeaderGroup() @@ -4458,7 +4457,7 @@ void X11Client::setFullScreen(bool set, bool user) GeometryUpdatesBlocker blocker2(this); // active fullscreens get different layer - workspace()->updateClientLayer(this); + updateLayer(); info->setState(isFullScreen() ? NET::FullScreen : NET::States(), NET::FullScreen); updateDecoration(false, false);