[effects/desktopgrid] Don't change activities

Summary:
If the Desktop Grid effect doesn't use the Present Windows effect to
layout windows, windowAt helper can return a window that doesn't belong
to current activity because it doesn't check whether that window belongs
to current activity.

This change addresses that problem by adding corresponding check.

BUG: 301447
FIXED-IN: 5.13.4

Test Plan:
//Unchecked "Use Present Windows effect to layout the windows".//

* Switched to activity #1
* Switched to virtual desktop #1
* Launched Konsole and maximized it(to increate hit area)
* Switched to activity #2
* Switched to virtual desktop #2
* Launched Dolphin and maximized it
* Activated the Desktop Grid effect, clicked on virtual desktop #1 (activity #2 is still active)
* Switched to activity #1
* Activated the Desktop Grid effect, clicked on virtual desktop #2 (activity #1 is still active)

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D14046
icc-effect-5.14.5
Vlad Zagorodniy 2018-07-11 15:40:28 +03:00
parent 45ecac676d
commit 0c3047a8f1
1 changed files with 1 additions and 1 deletions

View File

@ -862,7 +862,7 @@ EffectWindow* DesktopGridEffect::windowAt(QPoint pos) const
}
} else {
foreach (EffectWindow * w, windows) {
if (w->isOnDesktop(desktop) && !w->isMinimized() && w->geometry().contains(pos))
if (w->isOnDesktop(desktop) && w->isOnCurrentActivity() && !w->isMinimized() && w->geometry().contains(pos))
return w;
}
}