Bug 422319 - virtual desktop locks up systems if desktop names are removed in Virtual Desktops System Settings Module
Summary: virtual desktop locks up systems if desktop names are removed in Virtual Desk...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.18.5
Platform: Kubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: efficiency
: 455469 472140 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-06-01 10:53 UTC by Peter Fiser
Modified: 2024-01-30 14:54 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Fiser 2020-06-01 10:53:53 UTC
SUMMARY
Setting an empty string for Virtual Desktop names crashes the system.

STEPS TO REPRODUCE
1. Right click Pager widget> configure Virtual desktops (or otherwise navigate to the Virtual Desktops config screen
2. Remove names of Virtual Desktops one by one, leaving an empty string for the names
3. Apply changes

OBSERVED RESULT
Desktop hangs completely with hard reset necessary.

EXPECTED RESULT
The system not crashing would be nice. 
SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 5.18.5
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 5.58
Qt Version: 5.12.8

ADDITIONAL INFORMATION
I did not try setting just one desktop name to an empty string.
Comment 1 Patrick Silva 2021-06-11 01:51:14 UTC
I can reproduce this problem on X11 session of Plasma 5.22.
Keyboard and mouse inputs stop working with anything on my screen but I'm able to switch to a tty and restart SDDM.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.22.0
KDE Frameworks Version: 5.82.0
Qt Version: 5.15.2
Graphics Platform: X11
Comment 2 Patrick Silva 2021-06-11 01:56:08 UTC
coredumps when I reproduced the bug:

Thu 2021-06-10 22:43:28 -03   4427 1003 1003 SIGSEGV present  /usr/bin/plasma-discover                >
Thu 2021-06-10 22:42:58 -03   3020 1003 1003 SIGSEGV present  /usr/bin/kwin_x11                       >
Thu 2021-06-10 22:42:58 -03   3352 1003 1003 SIGSEGV present  /usr/bin/systemsettings5                >
Thu 2021-06-10 22:42:43 -03 103969 1003 1003 SIGABRT present  /usr/lib/drkonqi                        >
Thu 2021-06-10 22:42:43 -03 103994 1003 1003 SIGABRT present  /usr/lib/drkonqi                        >
Thu 2021-06-10 22:42:43 -03 103970 1003 1003 SIGABRT present  /usr/lib/drkonqi
Comment 3 Vlad Zahorodnii 2022-01-26 16:01:53 UTC
It looks like kwin and x11 stuff enter in positive feedback loop, where kwin changes virtual desktop, x11 stuff sees that and notifies that vd name has changed, kwin sees that rootinfo has different virtual desktop so it updates virtual desktop, and so on
Comment 4 Patrick Silva 2022-06-17 13:47:03 UTC
*** Bug 455469 has been marked as a duplicate of this bug. ***
Comment 5 Patrick Silva 2023-07-10 19:02:17 UTC
*** Bug 472140 has been marked as a duplicate of this bug. ***
Comment 6 Bug Janitor Service 2024-01-30 10:14:28 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5065
Comment 7 Vlad Zahorodnii 2024-01-30 14:54:03 UTC
Git commit def3a5055899b1a9000a18060575fefcc7173c1a by Vlad Zahorodnii.
Committed on 30/01/2024 at 12:14.
Pushed by vladz into branch 'master'.

Ignore external updates of _NET_DESKTOP_LAYOUT and _NET_DESKTOP_NAMES

At the moment, the desktop layout in _NET_DESKTOP_LAYOUT overwrites new
desktop layout with outdated information. This happens because kwin tries
to honor the desktop layout set by the pager. However, kwin itself
already acts as the pager. The pager applet in plasma doesn't attempt to
maintain _NET_DESKTOP_LAYOUT with proper values.

On the other hand, kwin trying to both update and also sync its state to
_NET_DESKTOP_LAYOUT and _NET_DESKTOP_NAMES has created a series of
issues, like lockups or rendering glitches.

Given that the window manager can ignore these properties, and the fact
that kwin already does act like a pager, this patch makes kwin ignore
external updates to _NET_DESKTOP_LAYOUT and _NET_DESKTOP_NAMES.

In order to modify the desktop layout on X11, use the dbus api. On
Wayland, either the dbus api or the virtual desktop wayland protocol.
Related: bug 480371

M  +25   -41   autotests/test_virtual_desktops.cpp
M  +1    -8    src/rootinfo_filter.cpp
M  +14   -69   src/virtualdesktops.cpp
M  +1    -5    src/virtualdesktops.h

https://invent.kde.org/plasma/kwin/-/commit/def3a5055899b1a9000a18060575fefcc7173c1a
Comment 8 Vlad Zahorodnii 2024-01-30 14:54:28 UTC
Git commit 0691a973f8f591b3ad41564f3e6bbb21c0ead53a by Vlad Zahorodnii.
Committed on 30/01/2024 at 14:54.
Pushed by vladz into branch 'Plasma/6.0'.

Ignore external updates of _NET_DESKTOP_LAYOUT and _NET_DESKTOP_NAMES

At the moment, the desktop layout in _NET_DESKTOP_LAYOUT overwrites new
desktop layout with outdated information. This happens because kwin tries
to honor the desktop layout set by the pager. However, kwin itself
already acts as the pager. The pager applet in plasma doesn't attempt to
maintain _NET_DESKTOP_LAYOUT with proper values.

On the other hand, kwin trying to both update and also sync its state to
_NET_DESKTOP_LAYOUT and _NET_DESKTOP_NAMES has created a series of
issues, like lockups or rendering glitches.

Given that the window manager can ignore these properties, and the fact
that kwin already does act like a pager, this patch makes kwin ignore
external updates to _NET_DESKTOP_LAYOUT and _NET_DESKTOP_NAMES.

In order to modify the desktop layout on X11, use the dbus api. On
Wayland, either the dbus api or the virtual desktop wayland protocol.
Related: bug 480371


(cherry picked from commit def3a5055899b1a9000a18060575fefcc7173c1a)

M  +25   -41   autotests/test_virtual_desktops.cpp
M  +1    -8    src/rootinfo_filter.cpp
M  +14   -69   src/virtualdesktops.cpp
M  +1    -5    src/virtualdesktops.h

https://invent.kde.org/plasma/kwin/-/commit/0691a973f8f591b3ad41564f3e6bbb21c0ead53a