From fe47a8d9b96e81407da06c7957a0065ac8902436 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 3 Jan 2019 16:47:28 +0000 Subject: [PATCH] [effects/slideback] Port away from deprecated EffectWindow::desktop Summary: Not only does the function windowsShareDesktop become a lot more complex with the new desktop cardinality comparing if they share any desktop isn't actually what we want. If I have 2 windows on desktop 1 and the lower stacked window is also on desktop 2, when I switch desktops the focus will change, but we don't want to animate anything here as on this dekstop it has nothing to slide in front of. Instead this patch simply checks both windows are on the current desktop. Test Plan: Loaded a few windows. Some on one, some on more. Before if a window was on desktop 1&2 it wouldn't animate on 2. Windows now seem to animate when they should and not when they shouldn't. Reviewers: #kwin, zzag Reviewed By: #kwin, zzag Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D17943 --- effects/slideback/slideback.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/effects/slideback/slideback.cpp b/effects/slideback/slideback.cpp index 757b436ded..c0b7aa9468 100644 --- a/effects/slideback/slideback.cpp +++ b/effects/slideback/slideback.cpp @@ -35,12 +35,6 @@ SlideBackEffect::SlideBackEffect() connect(effects, SIGNAL(tabBoxClosed()), SLOT(slotTabBoxClosed())); } -static inline bool windowsShareDesktop(EffectWindow *w1, EffectWindow *w2) -{ - return w1->isOnAllDesktops() || w2->isOnAllDesktops() || w1->desktop() == w2->desktop(); -} - - void SlideBackEffect::slotStackingOrderChanged() { if (effects->activeFullScreenEffect() || m_tabboxActive) { @@ -79,7 +73,7 @@ void SlideBackEffect::windowRaised(EffectWindow *w) currentFound = true; } } else { - if (isWindowUsable(tmp) && windowsShareDesktop(tmp, w)) { + if (isWindowUsable(tmp) && tmp->isOnCurrentDesktop() && w->isOnCurrentDesktop()) { // Do we have to move it? if (intersects(w, tmp->geometry())) { QRect slideRect;