[Switch Window Containment Action] Fix listing windows with just one virtual desktop
AbandonedPublic

Authored by broulik on May 29 2016, 5:39 PM.

Details

Reviewers
hein
graesslin
Group Reviewers
Plasma
Summary

When there is only one virtual desktop, TasksModel DesktopRole returns 0 instead of 1, so we never listed windows in this case.

BUG: 363656
FIXED-IN: 5.6.5

Test Plan

Seems to work.

I don't understand why the model does that, though:

int Task::desktop() const
{
    if (KWindowSystem::numberOfDesktops() < 2) {
        return 0;
    }

    return d->info.desktop();
}

Diff Detail

Repository
R120 Plasma Workspace
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik updated this revision to Diff 4040.May 29 2016, 5:39 PM
broulik retitled this revision from to [Switch Window Containment Action] Fix listing windows with just one virtual desktop.
broulik updated this object.
broulik edited the test plan for this revision. (Show Details)
broulik added reviewers: Plasma, hein, graesslin.
broulik set the repository for this revision to R120 Plasma Workspace.
Restricted Application added a project: Plasma. · View Herald TranscriptMay 29 2016, 5:39 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
hein edited edge metadata.May 30 2016, 4:56 AM

0 means "on all desktops", probably because of that.

If I set a window to show on all desktops, it reports -1.

graesslin edited edge metadata.May 30 2016, 8:47 AM

In NETWM -1 represents on all desktops

mart added a subscriber: mart.Jun 1 2016, 9:49 AM

there was an inconsistency at some point between the applet counting from 0 and x counting from 1 iirc, and nowdays *should* be possible to remove that if (KWindowSystem::numberOfDesktops() < 2) { code?

hein added a comment.Jun 6 2016, 6:47 PM

<kbroulik:#plasma> Sho_: https://phabricator.kde.org/D1706 is this still an issue with the new lib (the applet needs to be adjusted to use the new lib?)

Yes, this code stil uses the old lib.

broulik abandoned this revision.Apr 24 2018, 8:42 PM