Commit a0fe38c9 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

[wayland] Send only clients that were on the removed desktop to a new desktop

Summary:
Currently, if a virtual desktop was removed, then we'll try to send all
clients to the last virtual desktop even though most of those clients
weren't present on the removed virtual desktop.

Test Plan: Manually.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17576
parent 3e62f6aa
......@@ -438,9 +438,6 @@ public:
virtual QVector<VirtualDesktop *> desktops() const {
return m_desktops;
}
void removeDesktop(VirtualDesktop *desktop) {
m_desktops.removeAll(desktop);
}
QVector<uint> x11DesktopIds() const;
void setMinimized(bool set);
......
......@@ -227,9 +227,12 @@ void Workspace::init()
if (kwinApp()->operationMode() == Application::OperationModeWaylandOnly ||
kwinApp()->operationMode() == Application::OperationModeXwayland) {
for (auto it = m_allClients.constBegin(); it != m_allClients.constEnd(); ++it) {
const bool needsMove = (*it)->desktops().count() == 1;
(*it)->removeDesktop(desktop);
if (needsMove) {
if (!(*it)->desktops().contains(desktop)) {
continue;
}
if ((*it)->desktops().count() > 1) {
(*it)->leaveDesktop(desktop);
} else {
sendClientToDesktop(*it, qMin(desktop->x11DesktopNumber(), VirtualDesktopManager::self()->count()), true);
}
}
......
Markdown is supported
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