diff --git a/activities.cpp b/activities.cpp --- a/activities.cpp +++ b/activities.cpp @@ -73,6 +73,8 @@ void Activities::slotRemoved(const QString &activity) { foreach (X11Client *client, Workspace::self()->clientList()) { + if (client->isDesktop()) + continue; client->setOnActivity(activity, false); } //toss out any session data for it @@ -167,6 +169,8 @@ const QList &clients = ws->clientList(); for (auto it = clients.constBegin(); it != clients.constEnd(); ++it) { const X11Client *c = (*it); + if (c->isDesktop()) + continue; const QByteArray sessionId = c->sessionId(); if (sessionId.isEmpty()) { continue; //TODO support old wm_command apps too? diff --git a/composite.cpp b/composite.cpp --- a/composite.cpp +++ b/composite.cpp @@ -369,9 +369,6 @@ c->setupCompositing(); c->updateShadow(); } - for (X11Client *c : Workspace::self()->desktopList()) { - c->setupCompositing(); - } for (Unmanaged *c : Workspace::self()->unmanagedList()) { c->setupCompositing(); c->updateShadow(); @@ -427,9 +424,6 @@ for (X11Client *c : Workspace::self()->clientList()) { m_scene->removeToplevel(c); } - for (X11Client *c : Workspace::self()->desktopList()) { - m_scene->removeToplevel(c); - } for (Unmanaged *c : Workspace::self()->unmanagedList()) { m_scene->removeToplevel(c); } @@ -439,9 +433,6 @@ for (X11Client *c : Workspace::self()->clientList()) { c->finishCompositing(); } - for (X11Client *c : Workspace::self()->desktopList()) { - c->finishCompositing(); - } for (Unmanaged *c : Workspace::self()->unmanagedList()) { c->finishCompositing(); } @@ -755,9 +746,6 @@ if (repaintsPending(Workspace::self()->clientList())) { return true; } - if (repaintsPending(Workspace::self()->desktopList())) { - return true; - } if (repaintsPending(Workspace::self()->unmanagedList())) { return true; } diff --git a/debug_console.cpp b/debug_console.cpp --- a/debug_console.cpp +++ b/debug_console.cpp @@ -894,10 +894,6 @@ for (auto c : x11Clients) { m_x11Clients.append(c); } - const auto x11DesktopClients = workspace()->desktopList(); - for (auto c : x11DesktopClients) { - m_x11Clients.append(c); - } connect(workspace(), &Workspace::clientAdded, this, [this] (AbstractClient *client) { if (X11Client *x11Client = qobject_cast(client)) { @@ -1289,12 +1285,6 @@ } connect(c->surface(), &SurfaceInterface::subSurfaceTreeChanged, this, reset); } - for (auto c : workspace()->desktopList()) { - if (!c->surface()) { - continue; - } - connect(c->surface(), &SurfaceInterface::subSurfaceTreeChanged, this, reset); - } if (waylandServer()) { connect(waylandServer(), &WaylandServer::shellClientAdded, this, [this, reset] (AbstractClient *c) { @@ -1343,7 +1333,6 @@ } // toplevel are all windows return workspace()->allClientList().count() + - workspace()->desktopList().count() + workspace()->unmanagedList().count(); } @@ -1371,11 +1360,6 @@ return createIndex(row, column, allClients.at(row)->surface()); } int reference = allClients.count(); - const auto &desktopClients = workspace()->desktopList(); - if (row < reference + desktopClients.count()) { - return createIndex(row, column, desktopClients.at(row-reference)->surface()); - } - reference += desktopClients.count(); const auto &unmanaged = workspace()->unmanagedList(); if (row < reference + unmanaged.count()) { return createIndex(row, column, unmanaged.at(row-reference)->surface()); @@ -1423,13 +1407,6 @@ } } row = allClients.count(); - const auto &desktopClients = workspace()->desktopList(); - for (int i = 0; i < desktopClients.count(); i++) { - if (desktopClients.at(i)->surface() == parent) { - return createIndex(row + i, 0, parent); - } - } - row += desktopClients.count(); const auto &unmanaged = workspace()->unmanagedList(); for (int i = 0; i < unmanaged.count(); i++) { if (unmanaged.at(i)->surface() == parent) { diff --git a/layers.cpp b/layers.cpp --- a/layers.cpp +++ b/layers.cpp @@ -205,13 +205,10 @@ int pos = 0; xcb_window_t *cl(nullptr); if (propagate_new_clients) { - cl = new xcb_window_t[ manual_overlays.count() + desktops.count() + clients.count()]; + cl = new xcb_window_t[ manual_overlays.count() + clients.count()]; for (const auto win : manual_overlays) { cl[pos++] = win; } - // TODO this is still not completely in the map order - for (auto it = desktops.constBegin(); it != desktops.constEnd(); ++it) - cl[pos++] = (*it)->window(); for (auto it = clients.constBegin(); it != clients.constEnd(); ++it) cl[pos++] = (*it)->window(); rootInfo()->setClientList(cl, pos); diff --git a/workspace.h b/workspace.h --- a/workspace.h +++ b/workspace.h @@ -221,12 +221,6 @@ const QList &unmanagedList() const { return unmanaged; } - /** - * @return List of desktop "clients" currently managed by Workspace - */ - const QList &desktopList() const { - return desktops; - } /** * @return List of deleted "clients" currently managed by Workspace */ @@ -596,7 +590,6 @@ QList clients; QList m_allClients; - QList desktops; QList unmanaged; QList deleted; QList m_internalClients; @@ -780,7 +773,6 @@ void Workspace::forEachClient(std::function< void (X11Client *) > func) { std::for_each(clients.constBegin(), clients.constEnd(), func); - std::for_each(desktops.constBegin(), desktops.constEnd(), func); } inline diff --git a/workspace.cpp b/workspace.cpp --- a/workspace.cpp +++ b/workspace.cpp @@ -446,7 +446,7 @@ // No client activated in manage() if (new_active_client == nullptr) new_active_client = topClientOnDesktop(VirtualDesktopManager::self()->current(), -1); - if (new_active_client == nullptr && !desktops.isEmpty()) + if (new_active_client == nullptr) new_active_client = findDesktop(true, VirtualDesktopManager::self()->current()); } if (new_active_client != nullptr) @@ -477,7 +477,6 @@ // from crashing. clients.removeAll(c); m_allClients.removeAll(c); - desktops.removeAll(c); } X11Client::cleanupX11(); @@ -576,14 +575,13 @@ grp->gotLeader(c); if (c->isDesktop()) { - desktops.append(c); if (active_client == nullptr && should_get_focus.isEmpty() && c->isOnCurrentDesktop()) requestFocus(c); // TODO: Make sure desktop is active after startup if there's no other window active } else { FocusChain::self()->update(c, FocusChain::Update); - clients.append(c); - m_allClients.append(c); } + clients.append(c); + m_allClients.append(c); if (!unconstrained_stacking_order.contains(c)) unconstrained_stacking_order.append(c); // Raise if it hasn't got any stacking position yet if (!stacking_order.contains(c)) // It'll be updated later, and updateToolWindows() requires @@ -629,11 +627,10 @@ clientShortcutUpdated(c); // Needed, since this is otherwise delayed by setShortcut() and wouldn't run } - Q_ASSERT(clients.contains(c) || desktops.contains(c)); + Q_ASSERT(clients.contains(c)); // TODO: if marked client is removed, notify the marked list clients.removeAll(c); m_allClients.removeAll(c); - desktops.removeAll(c); markXStackingOrderAsDirty(); attention_chain.removeAll(c); Group* group = findGroup(c->window()); @@ -991,16 +988,14 @@ else if (active_client && active_client->isShown(true) && active_client->isOnCurrentDesktop()) c = active_client; - if (c == nullptr && !desktops.isEmpty()) + if (!c) c = findDesktop(true, desktop); if (c != active_client) setActiveClient(nullptr); if (c) requestFocus(c); - else if (!desktops.isEmpty()) - requestFocus(findDesktop(true, desktop)); else focusToNull(); } @@ -1107,16 +1102,14 @@ else if (active_client && active_client->isShown(true) && active_client->isOnCurrentDesktop() && active_client->isOnCurrentActivity()) c = active_client; - if (c == nullptr && !desktops.isEmpty()) + if (!c) c = findDesktop(true, VirtualDesktopManager::self()->current()); if (c != active_client) setActiveClient(nullptr); if (c) requestFocus(c); - else if (!desktops.isEmpty()) - requestFocus(findDesktop(true, VirtualDesktopManager::self()->current())); else focusToNull(); @@ -1659,20 +1652,14 @@ if (X11Client *ret = Toplevel::findInList(clients, func)) { return ret; } - if (X11Client *ret = Toplevel::findInList(desktops, func)) { - return ret; - } return nullptr; } AbstractClient *Workspace::findAbstractClient(std::function func) const { if (AbstractClient *ret = Toplevel::findInList(m_allClients, func)) { return ret; } - if (X11Client *ret = Toplevel::findInList(desktops, func)) { - return ret; - } if (InternalClient *ret = Toplevel::findInList(m_internalClients, func)) { return ret; } @@ -1719,9 +1706,6 @@ if (X11Client *ret = Toplevel::findInList(clients, func)) { return ret; } - if (X11Client *ret = Toplevel::findInList(desktops, func)) { - return ret; - } if (Unmanaged *ret = Toplevel::findInList(unmanaged, func)) { return ret; } @@ -1734,7 +1718,6 @@ void Workspace::forEachToplevel(std::function func) { std::for_each(m_allClients.constBegin(), m_allClients.constEnd(), func); - std::for_each(desktops.constBegin(), desktops.constEnd(), func); std::for_each(deleted.constBegin(), deleted.constEnd(), func); std::for_each(unmanaged.constBegin(), unmanaged.constEnd(), func); std::for_each(m_internalClients.constBegin(), m_internalClients.constEnd(), func); @@ -1755,7 +1738,6 @@ void Workspace::forEachAbstractClient(std::function< void (AbstractClient*) > func) { std::for_each(m_allClients.constBegin(), m_allClients.constEnd(), func); - std::for_each(desktops.constBegin(), desktops.constEnd(), func); std::for_each(m_internalClients.constBegin(), m_internalClients.constEnd(), func); }