Commit 9577423d authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Remove most_recently_raised micro optimization

This micro optimization is simply not worth having. raiseOrLowerClient()
is not in any hot path, besides that raiseClient() is not the only place
where a window can be raised above other windows. In addition to that,
the most_recently_raised check in raiseOrLowerClient() doesn't take into
account whether the cached window is on the current activity.
parent a3d32fa8
......@@ -277,14 +277,9 @@ AbstractClient* Workspace::findDesktop(bool topmost, int desktop) const
void Workspace::raiseOrLowerClient(AbstractClient *c)
{
if (!c) return;
AbstractClient* topmost = nullptr;
// TODO Q_ASSERT( block_stacking_updates == 0 );
if (most_recently_raised && stacking_order.contains(most_recently_raised) &&
most_recently_raised->isShown(true) && c->isOnCurrentDesktop())
topmost = most_recently_raised;
else
topmost = topClientOnDesktop(c->isOnAllDesktops() ? VirtualDesktopManager::self()->current() : c->desktop(),
options->isSeparateScreenFocus() ? c->screen() : -1);
const AbstractClient *topmost =
topClientOnDesktop(c->isOnAllDesktops() ? VirtualDesktopManager::self()->current() : c->desktop(),
options->isSeparateScreenFocus() ? c->screen() : -1);
if (c == topmost)
lowerClient(c);
......@@ -317,9 +312,6 @@ void Workspace::lowerClient(AbstractClient* c, bool nogroup)
lowerClient(wins[ i ], true);
}
}
if (c == most_recently_raised)
most_recently_raised = nullptr;
}
void Workspace::lowerClientWithinApplication(AbstractClient* c)
......@@ -372,10 +364,6 @@ void Workspace::raiseClient(AbstractClient* c, bool nogroup)
unconstrained_stacking_order.removeAll(c);
unconstrained_stacking_order.append(c);
if (!c->isSpecialWindow()) {
most_recently_raised = c;
}
}
void Workspace::raiseClientWithinApplication(AbstractClient* c)
......
......@@ -114,7 +114,6 @@ Workspace::Workspace()
, m_initialDesktop(1)
, active_client(nullptr)
, last_active_client(nullptr)
, most_recently_raised(nullptr)
, movingClient(nullptr)
, delayfocus_client(nullptr)
, force_restacking(false)
......@@ -650,8 +649,6 @@ void Workspace::removeClient(X11Client *c)
if (group != nullptr)
group->lostLeader();
if (c == most_recently_raised)
most_recently_raised = nullptr;
should_get_focus.removeAll(c);
if (c == active_client)
active_client = nullptr;
......@@ -768,9 +765,6 @@ void Workspace::removeShellClient(AbstractClient *client)
{
clientHidden(client);
m_allClients.removeAll(client);
if (client == most_recently_raised) {
most_recently_raised = nullptr;
}
if (client == delayfocus_client) {
cancelDelayFocus();
}
......
......@@ -576,7 +576,6 @@ private:
AbstractClient* active_client;
AbstractClient* last_active_client;
AbstractClient* most_recently_raised; // Used ONLY by raiseOrLowerClient()
AbstractClient* movingClient;
// Delay(ed) window focus timer and client
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment