Skip to content

Assign default name if new virtual desktop has no explicit name

If a virtual desktop has empty name, kwin is going to end up in an infinite cycle where VirtualDesktopManager::save() updates the _NET_DESKTOP_NAMES property and then in the next event loop cycle, RootInfoFilter::filter() is going to call VirtualDesktopManager::save() because the _NET_DESKTOP_NAMES property has been changed.

This regression has showed up just now because some parts of kwin used to increase virtual desktop count to create new desktops. Recently, that code was ported to VirtualDesktopManager::createVirtualDesktop().

The main difference between createVirtualDesktop() and setCount() is that the latter will set the desktop name to "Desktop N", the former will use user-specified name.

If the user-specified name is empty, the createVirtualDesktop() method should assign "Desktop N" name to the virtual desktop according to the docs. However, it's not the case and this change addresses that.

Edited by Vlad Zahorodnii

Merge request reports

Loading