summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Spilsbury <sam.spilsbury@canonical.com>2011-09-29 11:53:03 +0800
committerSam Spilsbury <sam.spilsbury@canonical.com>2011-09-29 11:53:03 +0800
commitaf223e5c09fd6c57ac31b59996008bc88eaa901b (patch)
tree0279e411073549badd0cc23fb03bd6c9d4209eef
parent8ab501cbf7677ddecdaeb435965832329f4d256c (diff)
parent54a59f4ef39df81aa50da158fb89e61bc34a5e76 (diff)
downloadcore-af223e5c09fd6c57ac31b59996008bc88eaa901b.tar.gz
core-af223e5c09fd6c57ac31b59996008bc88eaa901b.tar.bz2
Merge lp:~compiz-team/compiz-core/compiz-core.fix_716521
-rw-r--r--plugins/decor/src/decor.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/plugins/decor/src/decor.cpp b/plugins/decor/src/decor.cpp
index f1d6117..8bd2bdd 100644
--- a/plugins/decor/src/decor.cpp
+++ b/plugins/decor/src/decor.cpp
@@ -2780,6 +2780,10 @@ DecorWindow::stateChangeNotify (unsigned int lastState)
{
if (wd && wd->decor)
{
+ int oldShiftX = shiftX ();
+ int oldShiftY = shiftY ();
+ int moveDx, moveDy;
+
if ((window->state () & MAXIMIZE_STATE) == MAXIMIZE_STATE)
window->setWindowFrameExtents (&wd->decor->maxBorder,
&wd->decor->maxInput);
@@ -2787,6 +2791,20 @@ DecorWindow::stateChangeNotify (unsigned int lastState)
window->setWindowFrameExtents (&wd->decor->border,
&wd->decor->input);
+ /* Since we immediately update the frame extents, we must
+ * also update the stored saved window geometry in order
+ * to prevent the window from shifting back too far once
+ * unmaximized */
+
+ moveDx = shiftX () - oldShiftX;
+ moveDy = shiftY () - oldShiftY;
+
+ if (window->saveMask () & CWX)
+ window->saveWc ().x += moveDx;
+
+ if (window->saveMask () & CWY)
+ window->saveWc ().y += moveDy;
+
updateFrame ();
}
}