Fix VirtualDesktopManager::createVirtualDesktop
ClosedPublic

Authored by zzag on Jan 17 2019, 6:10 PM.

Details

Summary

Currently, there are several issues with
VirtualDesktopManager::createVirtualDesktop:

(a) The method expects the number parameter to be in range [1, count + 1],

but we pass [0, count];

(b) It doesn't correctly update X11 desktop numbers.

This change tries to address all previously mentioned issues.

BUG: 403312
FIXED-IN: 5.15.0

Test Plan

No longer able to reproduce bug 403312.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
zzag created this revision.Jan 17 2019, 6:10 PM
Restricted Application added a project: KWin. · View Herald TranscriptJan 17 2019, 6:10 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Jan 17 2019, 6:10 PM
zzag edited the summary of this revision. (Show Details)Jan 17 2019, 6:15 PM
zzag added a subscriber: hein.Jan 17 2019, 6:21 PM

@hein The Pager applet can have "dead" virtual desktops after repeating "add virtual desktop - remove virtual desktop" cycle for several times.

zzag added a comment.Jan 17 2019, 6:23 PM

It doesn't look like a KWin issue.

zzag edited the summary of this revision. (Show Details)Jan 17 2019, 6:24 PM
zzag planned changes to this revision.Jan 17 2019, 8:17 PM

Hmm, no, that's a problem on KWin side.

zzag updated this revision to Diff 49757.Jan 17 2019, 9:24 PM

Overhaul plasma virtual desktop interface creation (it's broken right now).

I'll re-title the revision tomorrow.

zzag planned changes to this revision.Jan 17 2019, 9:25 PM
zzag updated this revision to Diff 49764.Jan 17 2019, 10:20 PM
zzag retitled this revision from Correctly update X11 desktop ids to Fix VirtualDesktopManager::createvirtualDesktop.
zzag edited the summary of this revision. (Show Details)

Split the commit.

zzag updated this revision to Diff 49766.Jan 17 2019, 10:27 PM

edit comment

zzag updated this revision to Diff 49768.Jan 17 2019, 10:28 PM

wrong diff

zzag retitled this revision from Fix VirtualDesktopManager::createvirtualDesktop to Fix VirtualDesktopManager::createVirtualDesktop.Jan 17 2019, 10:31 PM
zzag planned changes to this revision.Jan 17 2019, 11:43 PM
zzag updated this revision to Diff 49794.Jan 18 2019, 9:23 AM

Pass zero-based position in VirtualDesktopManagerDBusInterface::createDesktop

Changes definitely make sense, much more readable now.

One minor comment, then ship it.

virtualdesktops.cpp
454–456

I think we need to validate that position <= count() either here or in the DBus wrapper.

zzag updated this revision to Diff 50009.Jan 21 2019, 5:54 PM

Use bounded position

davidedmundson accepted this revision.Jan 21 2019, 5:57 PM
This revision is now accepted and ready to land.Jan 21 2019, 5:57 PM
This revision was automatically updated to reflect the committed changes.