summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/resize.c
diff options
context:
space:
mode:
authoronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-12-02 00:16:25 +0000
committeronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-12-02 00:16:25 +0000
commitd305140272d2579897300e435417f1bdb6f73b64 (patch)
tree107b83e85f502cb549ad985e6a7260dcd562f451 /beryl-plugins/src/resize.c
parent7ca2f6633b0a3549966f1f5e89a595ecc9045f24 (diff)
downloadmarex-dev-d305140272d2579897300e435417f1bdb6f73b64.tar.gz
marex-dev-d305140272d2579897300e435417f1bdb6f73b64.tar.bz2
beryl-plugins: resize: partially revert 1482. Fixed window menu initiated mouse window resize.
git-svn-id: file:///beryl/trunk@1491 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/resize.c')
-rw-r--r--beryl-plugins/src/resize.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/beryl-plugins/src/resize.c b/beryl-plugins/src/resize.c
index a8a7669..53077e4 100644
--- a/beryl-plugins/src/resize.c
+++ b/beryl-plugins/src/resize.c
@@ -574,7 +574,7 @@ static Bool resizeTerminate (CompDisplay *d,
configureXWindow (rd->w, CWX | CWY | CWWidth | CWHeight, &xwc);
resizeWindow (rd->w, rd->savedAttrib.x, rd->savedAttrib.y, rd->savedAttrib.width, rd->savedAttrib.height, rd->w->attrib.border_width);
- } else if (rd->resizeMode != ResizeModeNormal)
+ } else if (rd->resizeMode != ResizeModeNormal)
resizeUpdateWindowRealSize (d, 0);
else
syncWindowPosition (rd->w);
@@ -667,6 +667,14 @@ static void resizeHandleMotionEvent (CompScreen *s, int xRoot, int yRoot)
if (!rs->grabIndex)
return;
+ if (rd->mask == 0 && rd->w)
+ {
+ rd->mask = ((xRoot - rd->w->attrib.x) < (rd->w->width / 2)) ?
+ ResizeLeftMask : ResizeRightMask;
+ rd->mask |= ((yRoot - rd->w->attrib.y) < (rd->w->height / 2)) ?
+ ResizeUpMask : ResizeDownMask;
+ }
+
pointerDx = xRoot - rd->currentX;
pointerDy = yRoot - rd->currentY;
@@ -788,6 +796,21 @@ static void resizeHandleEvent (CompDisplay *d, XEvent *event)
case KeyRelease:
break;
+ case ButtonPress:
+ s = findScreenAtDisplay (d, event->xbutton.root);
+ if (s)
+ {
+ RESIZE_SCREEN (s);
+
+ if (rs->grabIndex)
+ {
+ resizeTerminate (d,
+ &rd->opt[RESIZE_DISPLAY_OPTION_INITIATE].value.action,
+ 0, NULL, 0);
+ }
+ }
+ break;
+
case ButtonRelease: {
CompAction *action =
&rd->opt[RESIZE_DISPLAY_OPTION_INITIATE].value.action;