Commit a0fe38c9 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

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

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:
parent 3e62f6aa
......@@ -438,9 +438,6 @@ public:
virtual QVector<VirtualDesktop *> desktops() const {
return m_desktops;
void removeDesktop(VirtualDesktop *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;
if (needsMove) {
if (!(*it)->desktops().contains(desktop)) {
if ((*it)->desktops().count() > 1) {
} 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