Bug 480371 - The last virtual desktop is not deleted correctly
Summary: The last virtual desktop is not deleted correctly
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: master
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6, wayland
Depends on:
Blocks:
 
Reported: 2024-01-26 19:47 UTC by Жора Змейкин
Modified: 2024-01-30 14:54 UTC (History)
2 users (show)

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


Attachments
Demonstration (2.92 MB, video/mp4)
2024-01-26 19:47 UTC, Жора Змейкин
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Жора Змейкин 2024-01-26 19:47:35 UTC
Created attachment 165255 [details]
Demonstration

SUMMARY
If you delete the last virtual desktop, it remains as a black rectangle when you switch between the last and the first desktop. This doesn't bother you if you switch between desktops using Ctrl + Meta + Left/Right, but it is very annoying if you switch between desktops using the touchpad.

STEPS TO REPRODUCE
1. Create 3 desktops.
2. Restart the KWin process or rejoin the session.
3. Delete the last desktop.
4. Try switching between virtual desktops.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon Unstable, Wayland
KDE Plasma Version: 6.0.80
KDE Frameworks Version: 5.249.0
Qt Version: 6.6.1

ADDITIONAL INFORMATION
Attached a video of a demonstration. I recorded the video after restarting KWin.
Comment 1 Doug 2024-01-28 06:33:53 UTC
Can confirm on KDE Neon Testing.
Comment 2 Nate Graham 2024-01-29 21:16:51 UTC
Thanks for the screen recording. Unfortunately I cannot reproduce the issue by following those steps using current git master of Plasma 6 Wayland with Qt 6.6.0 on top of Fedora 39.

After you restarted KWin in step 2, Did you quit and re-launch System Settings, or was it already open before you restarted KWin and it stayed open?
Comment 3 Жора Змейкин 2024-01-29 22:13:27 UTC
After restarting KWin, the settings remained open. I was able to reproduce this bug even outside the settings, creating and deleting desktops via Desktop Grid(In reply to Nate Graham from comment #2)
> Thanks for the screen recording. Unfortunately I cannot reproduce the issue
> by following those steps using current git master of Plasma 6 Wayland with
> Qt 6.6.0 on top of Fedora 39.
> 
> After you restarted KWin in step 2, Did you quit and re-launch System
> Settings, or was it already open before you restarted KWin and it stayed
> open?

After restarting KWin, the settings remained open. I was able to reproduce this bug even outside the settings, creating and deleting desktops via Desktop Grid
Comment 4 Bug Janitor Service 2024-01-30 10:14:29 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/5065
Comment 5 Vlad Zahorodnii 2024-01-30 14:54:11 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 422319

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 6 Vlad Zahorodnii 2024-01-30 14:54:36 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 422319


(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