From 4c0f9f8bbdc12a31941b471cdf50c9b2b6b7fec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 21 Jan 2013 08:42:15 +0100 Subject: [PATCH] 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. --- geometry.cpp | 47 ++--------------------------------------------- 1 file changed, 2 insertions(+), 45 deletions(-) diff --git a/geometry.cpp b/geometry.cpp index 0749f5d8a7..ae7ad26f22 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -2574,9 +2574,7 @@ bool Client::startMoveResize() Notify::raise(isResize() ? Notify::ResizeStart : Notify::MoveStart); emit clientStartUserMovedResized(this); #ifdef KWIN_BUILD_SCREENEDGES - if (options->electricBorders() == Options::ElectricMoveOnly || - options->electricBorderMaximize() || - options->electricBorderTiling()) + if (options->electricBorders() == Options::ElectricMoveOnly) workspace()->screenEdge()->reserveDesktopSwitching(true, Qt::Vertical|Qt::Horizontal); #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!! @@ -2584,37 +2582,6 @@ bool Client::startMoveResize() 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) { const bool wasResize = isResize(); // store across leaveMoveResize @@ -2642,14 +2609,6 @@ void Client::finishMoveResize(bool cancel) if (isElectricBorderMaximizing()) { 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; workspace()->outline()->hide(); } else if (!cancel) { @@ -2697,9 +2656,7 @@ void Client::leaveMoveResize() syncRequest.timeout = NULL; #endif #ifdef KWIN_BUILD_SCREENEDGES - if (options->electricBorders() == Options::ElectricMoveOnly || - options->electricBorderMaximize() || - options->electricBorderTiling()) + if (options->electricBorders() == Options::ElectricMoveOnly) workspace()->screenEdge()->reserveDesktopSwitching(false, Qt::Vertical|Qt::Horizontal); #endif }