diff options
author | Sam Spilsbury <sam.spilsbury@canonical.com> | 2010-12-07 21:23:10 +0800 |
---|---|---|
committer | Sam Spilsbury <sam.spilsbury@canonical.com> | 2010-12-07 21:23:10 +0800 |
commit | 964dc2bf03c2a1b3401e0bd9f99d880cd1e3e5c5 (patch) | |
tree | fb196ab97207d103719f200e67b6bafa08508db6 /plugins | |
parent | aecc2baa84c4c16e39569c6789306081246aaa67 (diff) | |
download | compiz-with-glib-mainloop-964dc2bf03c2a1b3401e0bd9f99d880cd1e3e5c5.tar.gz compiz-with-glib-mainloop-964dc2bf03c2a1b3401e0bd9f99d880cd1e3e5c5.tar.bz2 |
resize: Allow resizing outside screen edges when initiated with key.
Forward port 6e281003bbcb01ac028aa963ab1bee0349c41376 to master
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/resize/src/resize.cpp | 11 | ||||
-rw-r--r-- | plugins/resize/src/resize.h | 1 |
2 files changed, 8 insertions, 4 deletions
diff --git a/plugins/resize/src/resize.cpp b/plugins/resize/src/resize.cpp index 5578b57..ecf57ba 100644 --- a/plugins/resize/src/resize.cpp +++ b/plugins/resize/src/resize.cpp @@ -353,6 +353,7 @@ resizeInitiate (CompAction *action, /* Update yConstrained and workArea at grab time */ pMove = CompPlugin::find ("move"); rs->yConstrained = false; + rs->offScreenConstrained = false; if (pMove) { CompOption::Vector &options = pMove->vTable->getOptions (); @@ -371,6 +372,7 @@ resizeInitiate (CompAction *action, if (sourceExternalApp) { + rs->offScreenConstrained = true; /* Prevent resizing beyond work area edges when resize is initiated externally (e.g. with window frame or menu) and not with a key (e.g. alt+button) */ @@ -750,7 +752,7 @@ ResizeScreen::handleMotionEvent (int xRoot, int yRoot) } /* constrain to screen */ - if (mask & ResizeDownMask) + if (mask & ResizeDownMask && offScreenConstrained) { int decorBottom = savedGeometry.y + che + w->input ().bottom; @@ -758,7 +760,7 @@ ResizeScreen::handleMotionEvent (int xRoot, int yRoot) che -= decorBottom = screen->height (); } - if (mask & ResizeLeftMask) + if (mask & ResizeLeftMask && offScreenConstrained) { int decorLeft = savedGeometry.x + savedGeometry.width - (cwi + w->input ().left); @@ -767,7 +769,7 @@ ResizeScreen::handleMotionEvent (int xRoot, int yRoot) cwi += decorLeft; } - if (mask & ResizeRightMask) + if (mask & ResizeRightMask && offScreenConstrained) { int decorRight = savedGeometry.x + cwi + w->input ().right; @@ -1543,7 +1545,8 @@ ResizeScreen::ResizeScreen (CompScreen *s) : centeredMask (0), releaseButton (0), isConstrained (false), - yConstrained (true) + yConstrained (true), + offScreenConstrained (true) { CompOption::Vector atomTemplate; Display *dpy = s->dpy (); diff --git a/plugins/resize/src/resize.h b/plugins/resize/src/resize.h index 1293336..b0957ad 100644 --- a/plugins/resize/src/resize.h +++ b/plugins/resize/src/resize.h @@ -148,6 +148,7 @@ class ResizeScreen : CompSize lastGoodSize; bool yConstrained; + bool offScreenConstrained; const CompRect *grabWindowWorkArea; }; |