summaryrefslogtreecommitdiff
authorSam Spilsbury <smspillaz@gmail.com>2010-03-15 13:21:13 (GMT)
committer Sam Spilsbury <smspillaz@gmail.com>2010-03-15 13:21:13 (GMT)
commitaea1f07bd4c4d157a26ab8571250dfa0df904144 (patch) (side-by-side diff)
tree1abdfa1f44987460b54ebf3b9eaea71f6ba9fc80
parent9370c5e532abffbe40d7a07b8cdb0833e12e04ba (diff)
downloadcore-aea1f07bd4c4d157a26ab8571250dfa0df904144.tar.gz
core-aea1f07bd4c4d157a26ab8571250dfa0df904144.tar.bz2
Fix window position validation for windows changing size but not position
Previously, we left the position of windows that have USPosition set untouched, even if they didn't try to change position at all, but only changed size. This caused such windows to become partially offscreen e.g. if they were positioned at the lower edge of the work area before the size change and increased height afterwards. Forward port of 3c16152938c44454f42d08a4b92cc46093c9a782 to master
-rw-r--r--plugins/place/src/place.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/place/src/place.cpp b/plugins/place/src/place.cpp
index f276161..52e9ee7 100644
--- a/plugins/place/src/place.cpp
+++ b/plugins/place/src/place.cpp
@@ -590,6 +590,12 @@ PlaceWindow::doValidateResizeRequest (unsigned int &mask,
top += window->input ().top;
bottom -= window->input ().bottom + 2 * window->serverGeometry ().border ();
+ /* always validate position if the application changed only its size,
+ as it might become partially offscreen because of that */
+
+ if (!(*mask & (CWX | CWY)) && (*mask & (CWWidth | CWHeight)))
+ sizeOnly = FALSE;
+
if ((right - left) != xwc->width)
{
xwc->width = right - left;