[desktopgrid] Don't manipulate virtual desktop of desktop window

Summary:
Desktop Grid has a feature that right or middle clicking a window toggles
the on all desktop state. If that is done for a desktop window, things
obviously start to fail.

KWin internally allows to change virtual desktop for all windows, even
for windows like the desktop or docks. Changing in KWin core is not a
solution.

Thus a special casing in desktop grid is added to disallow the selection
for desktop windows.

BUG: 372037
FIXED-IN: 5.8.4

Test Plan: Tried right clicking desktop window and other windows.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D3253
This commit is contained in:
Martin Gräßlin 2016-11-04 09:28:06 +01:00
parent da0ba76324
commit 3c6371390d

View file

@ -560,6 +560,9 @@ void DesktopGridEffect::windowInputMouseEvent(QEvent* e)
}
} else if ((me->buttons() == Qt::MidButton || me->buttons() == Qt::RightButton) && windowMove == NULL) {
EffectWindow* w = windowAt(me->pos());
if (w && w->isDesktop()) {
w = nullptr;
}
if (w != NULL) {
int desktop = 0;
if (w->isOnAllDesktops()) {