Consistent virtual desktop numbering between Switch Window popup and taskbar
ClosedPublic

Authored by marten on Jul 25 2019, 3:17 PM.

Details

Summary

Bug https://bugs.kde.org/show_bug.cgi?id=410190 describes the inconsistent virtual desktop numbering between the Switch Window popup and the taskbar Move To Desktop list. This patch fixes the Switch Window popup to use the more natural (to the user) 1-based desktop IDs.

According to virtualdesktopinfo.h, a desktop ID on Wayland is a QString while on X11 it is a uint. Therefore using toString() here for correct formatting of the desktop ID on both X11 and Wayland.

CCBUG: 410190

Test Plan

Built plasma-workspace with this change, observed correct and consistent desktop numbering in both these places. Not yet able to test on Wayland.

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
marten created this revision.Jul 25 2019, 3:17 PM
Restricted Application added a project: Plasma. · View Herald TranscriptJul 25 2019, 3:17 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
marten requested review of this revision.Jul 25 2019, 3:17 PM
cfeck added a subscriber: cfeck.Aug 15 2019, 1:59 PM

Could someone test this on Wayland? The fix itself looks trivial, but if it breaks Wayland session, it obviously needs to be changed.

So does this fully fix 410190, or only partially?

So does this fully fix 410190, or only partially?

Fixes it completely for X11.
Should really verify on Wayland before considering the bug to be completely fixed.

ngraham edited the summary of this revision. (Show Details)Aug 17 2019, 7:42 PM

Cool, thanks. Once it's verified on Wayland, we can change CCBUG: to BUG:.

GB_2 added a subscriber: GB_2.Aug 17 2019, 7:59 PM

I just tried it on Wayland and it looks like for some reason instead of a number it shows some kind of UUID.

marten planned changes to this revision.Aug 18 2019, 8:47 AM

@GB_2 thanks for testing; a desktop UUID is obviously not friendly to show to the user, so there needs to be some sort of X11/Wayland runtime check here.

marten updated this revision to Diff 66138.Sep 15 2019, 4:37 PM

Ignore the desktop ID and simply use the loop index, adjusted so that the desktop numbers start at 1. This is the same formatting as used by KWin (kwin/useractions.cpp) and the Task Manager applet (plasma-desktop/applets/taskmanager/package/contents/ui/ContextMenu.qml). This should work as intended on both X11 and Wayland.

zzag accepted this revision.Sep 15 2019, 7:38 PM
zzag added a subscriber: zzag.

@GB_2 thanks for testing; a desktop UUID is obviously not friendly to show to the user, so there needs to be some sort of X11/Wayland runtime check here.

Yes, that's right, KWin will generate a UUID for each new virtual desktop.

This revision is now accepted and ready to land.Sep 15 2019, 7:38 PM
This revision was automatically updated to reflect the committed changes.