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
This commit is contained in:
Martin Gräßlin 2013-01-30 13:36:37 +01:00
parent 97943019db
commit beb00478e1
3 changed files with 11 additions and 1 deletions

View file

@ -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
}

View file

@ -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) {

View file

@ -124,7 +124,9 @@ enum TabBoxMode {
};
enum KWinOption {
CloseButtonCorner
CloseButtonCorner,
SwitchDesktopOnScreenEdge,
SwitchDesktopOnScreenEdgeMovingWindows
};
inline