From beb00478e15f5f591cba0c0ea8844f3cac44df11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 30 Jan 2013 13:36:37 +0100 Subject: [PATCH] Only start animating in cube slide on window move if core uses switch desktop on edge For this new KWinOptions are exposed to query whether core uses switch on desktop on move or always. BUG: 299901 FIXED-IN: 4.11 REVIEW: 108671 --- effects.cpp | 4 ++++ effects/cube/cubeslide.cpp | 4 ++++ libkwineffects/kwinglobals.h | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/effects.cpp b/effects.cpp index 5c6272c602..b6eba83cc0 100644 --- a/effects.cpp +++ b/effects.cpp @@ -1496,6 +1496,10 @@ QVariant EffectsHandlerImpl::kwinOption(KWinOption kwopt) switch (kwopt) { case CloseButtonCorner: return Workspace::self()->decorationCloseButtonCorner(); + case SwitchDesktopOnScreenEdge: + return ScreenEdges::self()->isDesktopSwitching(); + case SwitchDesktopOnScreenEdgeMovingWindows: + return ScreenEdges::self()->isDesktopSwitchingMovingClients(); } return QVariant(); // an invalid one } diff --git a/effects/cube/cubeslide.cpp b/effects/cube/cubeslide.cpp index aa933ae971..f0459058bf 100644 --- a/effects/cube/cubeslide.cpp +++ b/effects/cube/cubeslide.cpp @@ -519,6 +519,8 @@ void CubeSlideEffect::slotWindowStepUserMovedResized(EffectWindow* w) { if (!useWindowMoving) return; + if (!effects->kwinOption(SwitchDesktopOnScreenEdgeMovingWindows).toBool()) + return; if (w->isUserResize()) return; const QPoint cursor = effects->cursorPos(); @@ -556,6 +558,8 @@ void CubeSlideEffect::slotWindowFinishUserMovedResized(EffectWindow* w) { if (!useWindowMoving) return; + if (!effects->kwinOption(SwitchDesktopOnScreenEdgeMovingWindows).toBool()) + return; if (w->isUserResize()) return; if (!desktopChangedWhileMoving) { diff --git a/libkwineffects/kwinglobals.h b/libkwineffects/kwinglobals.h index a8cd692bd3..b1894e59ba 100644 --- a/libkwineffects/kwinglobals.h +++ b/libkwineffects/kwinglobals.h @@ -124,7 +124,9 @@ enum TabBoxMode { }; enum KWinOption { - CloseButtonCorner + CloseButtonCorner, + SwitchDesktopOnScreenEdge, + SwitchDesktopOnScreenEdgeMovingWindows }; inline