aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Lübking <thomas.luebking@gmail.com>2011-08-23 20:51:49 (GMT)
committerThomas Lübking <thomas.luebking@gmail.com>2011-08-23 20:54:41 (GMT)
commitea91e9dea63cf58fcf0d45d7e2f4783d0b70b8bb (patch)
tree3eb0534f89e5dcb97c53b9cfaf2c16498ed21177
parent8085f9abb79c0a915107e2522355b3393310dce4 (diff)
check workspace position after screen change of any max'd client
also only unset max'd state when resizing, but not when moving a max'd client BUG: 279051 CCBUG: 279529 REVIEW: 102414
-rw-r--r--kwin/client.h2
-rw-r--r--kwin/geometry.cpp16
2 files changed, 12 insertions, 6 deletions
diff --git a/kwin/client.h b/kwin/client.h
index c0a87db..2f65c38 100644
--- a/kwin/client.h
+++ b/kwin/client.h
@@ -644,7 +644,7 @@ private:
uint urgency : 1; ///< XWMHints, UrgencyHint
uint ignore_focus_stealing : 1; ///< Don't apply focus stealing prevention to this client
uint demands_attention : 1;
- int m_screenNum;
+ int m_screenNum, m_formerScreenNum;
bool blocks_compositing;
WindowRules client_rules;
void getWMHints();
diff --git a/kwin/geometry.cpp b/kwin/geometry.cpp
index 56248ae..3873422 100644
--- a/kwin/geometry.cpp
+++ b/kwin/geometry.cpp
@@ -2628,13 +2628,17 @@ bool Client::startMoveResize()
return false;
}
+ m_formerScreenNum = screen();
+
// If we have quick maximization enabled then it's safe to automatically restore windows
// when starting a move as the user can undo their action by moving the window back to
// the top of the screen. When the setting is disabled then doing so is confusing.
- if (maximizeMode() == MaximizeFull && options->moveResizeMaximizedWindows()) {
- // allow move resize, but unset maximization state
- geom_restore = geom_pretile = geometry(); // "restore" to current geometry
- setMaximize(false, false);
+ if (maximizeMode() != MaximizeRestore && options->moveResizeMaximizedWindows()) {
+ // allow moveResize, but unset maximization state in resize case
+ if (mode != PositionCenter) { // means "isResize()" but moveResizeMode = true is set below
+ geom_restore = geom_pretile = geometry(); // "restore" to current geometry
+ setMaximize(false, false);
+ }
} else if ((maximizeMode() == MaximizeFull && options->electricBorderMaximize()) ||
(quick_tile_mode != QuickTileNone && isMovable() && mode == PositionCenter)) {
// Exit quick tile mode when the user attempts to move a tiled window, cannot use isMove() yet
@@ -2724,8 +2728,10 @@ void Client::finishMoveResize(bool cancel)
setGeometry(initialMoveResizeGeom);
else
setGeometry(moveResizeGeom);
+ if (maximizeMode() != MaximizeRestore && m_formerScreenNum != screen())
+ checkWorkspacePosition();
}
- if (cancel)
+ if (cancel) // TODO: this looks like a patch bug - tiling gets the variable and non-tiling acts above
setGeometry(initialMoveResizeGeom);
if (isElectricBorderMaximizing()) {