Remove interaction of quick tiling with ScreenEdges

Quick tiling/maximizing of Clients is completely independent of the
screen edges functionality. That is it determines the borders itself.
Nevertheless there has been some code still around which interacted with
the screen edges each time a window was moved. This code is completely
useless.
This commit is contained in:
Martin Gräßlin 2013-01-21 08:42:15 +01:00
parent e47fdf5caa
commit 4c0f9f8bbd

View file

@ -2574,9 +2574,7 @@ bool Client::startMoveResize()
Notify::raise(isResize() ? Notify::ResizeStart : Notify::MoveStart); Notify::raise(isResize() ? Notify::ResizeStart : Notify::MoveStart);
emit clientStartUserMovedResized(this); emit clientStartUserMovedResized(this);
#ifdef KWIN_BUILD_SCREENEDGES #ifdef KWIN_BUILD_SCREENEDGES
if (options->electricBorders() == Options::ElectricMoveOnly || if (options->electricBorders() == Options::ElectricMoveOnly)
options->electricBorderMaximize() ||
options->electricBorderTiling())
workspace()->screenEdge()->reserveDesktopSwitching(true, Qt::Vertical|Qt::Horizontal); workspace()->screenEdge()->reserveDesktopSwitching(true, Qt::Vertical|Qt::Horizontal);
#endif #endif
if (fakeMove) // fix geom_restore position - it HAS to happen at the end, ie. when all moving is set up. inline call will lock focus!! if (fakeMove) // fix geom_restore position - it HAS to happen at the end, ie. when all moving is set up. inline call will lock focus!!
@ -2584,37 +2582,6 @@ bool Client::startMoveResize()
return true; return true;
} }
static ElectricBorder electricBorderFromMode(QuickTileMode mode)
{
// special case, currently maxmizing is done from the electric top corner
if (mode == QuickTileMaximize)
return ElectricTop;
// sanitize the mode, ie. simplify "invalid" combinations
if ((mode & QuickTileHorizontal) == QuickTileHorizontal)
mode &= ~QuickTileHorizontal;
if ((mode & QuickTileVertical) == QuickTileVertical)
mode &= ~QuickTileVertical;
if (mode == QuickTileLeft)
return ElectricLeft;
if (mode == QuickTileRight)
return ElectricRight;
if (mode == (QuickTileTop|QuickTileLeft))
return ElectricTopLeft;
if (mode == (QuickTileTop|QuickTileRight))
return ElectricTopRight;
if (mode == (QuickTileBottom|QuickTileLeft))
return ElectricBottomLeft;
if (mode == (QuickTileBottom|QuickTileRight))
return ElectricBottomRight;
if (mode == QuickTileTop)
return ElectricTop;
if (mode == QuickTileBottom)
return ElectricBottom;
return ElectricNone;
}
void Client::finishMoveResize(bool cancel) void Client::finishMoveResize(bool cancel)
{ {
const bool wasResize = isResize(); // store across leaveMoveResize const bool wasResize = isResize(); // store across leaveMoveResize
@ -2642,14 +2609,6 @@ void Client::finishMoveResize(bool cancel)
if (isElectricBorderMaximizing()) { if (isElectricBorderMaximizing()) {
setQuickTileMode(electricMode); setQuickTileMode(electricMode);
const ElectricBorder border = electricBorderFromMode(electricMode);
if (border == ElectricNone)
kDebug(1212) << "invalid electric mode" << electricMode << "leading to invalid array access,\
this should not have happened!";
#ifdef KWIN_BUILD_SCREENEDGES
else
workspace()->screenEdge()->restoreSize(border);
#endif
electricMaximizing = false; electricMaximizing = false;
workspace()->outline()->hide(); workspace()->outline()->hide();
} else if (!cancel) { } else if (!cancel) {
@ -2697,9 +2656,7 @@ void Client::leaveMoveResize()
syncRequest.timeout = NULL; syncRequest.timeout = NULL;
#endif #endif
#ifdef KWIN_BUILD_SCREENEDGES #ifdef KWIN_BUILD_SCREENEDGES
if (options->electricBorders() == Options::ElectricMoveOnly || if (options->electricBorders() == Options::ElectricMoveOnly)
options->electricBorderMaximize() ||
options->electricBorderTiling())
workspace()->screenEdge()->reserveDesktopSwitching(false, Qt::Vertical|Qt::Horizontal); workspace()->screenEdge()->reserveDesktopSwitching(false, Qt::Vertical|Qt::Horizontal);
#endif #endif
} }