summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/resize.c
diff options
context:
space:
mode:
authornigel <nigel@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-11-06 05:15:23 +0000
committernigel <nigel@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-11-06 05:15:23 +0000
commit1443bb31ee926b31b6f1ea339e633360fd5b2dc7 (patch)
tree422036b70acabe3d76559e1acd11a51a1aadf858 /beryl-plugins/src/resize.c
parent89c3bfe06a6cff950ded139217bef62cfb7c5b52 (diff)
downloadmarex-dev-1443bb31ee926b31b6f1ea339e633360fd5b2dc7.tar.gz
marex-dev-1443bb31ee926b31b6f1ea339e633360fd5b2dc7.tar.bz2
resize plugin: Record the offset within the window after warping the pointer
instead of before. git-svn-id: file:///beryl/trunk@1039 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/resize.c')
-rw-r--r--beryl-plugins/src/resize.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/beryl-plugins/src/resize.c b/beryl-plugins/src/resize.c
index 68b6c7e..73a7fa2 100644
--- a/beryl-plugins/src/resize.c
+++ b/beryl-plugins/src/resize.c
@@ -449,14 +449,7 @@ static Bool resizeInitiate (CompDisplay *d,
rd->savedAttrib = w->attrib;
rd->right_edge = rd->currentX + rd->currentWidth;
rd->bottom_edge = rd->currentY + rd->currentHeight;
-
- rd->xdelta = (x - rd->currentX);
- if (rd->mask & ResizeRightMask)
- rd->xdelta = rd->width - rd->xdelta;
-
- rd->ydelta = (y - rd->currentY);
- if (rd->mask & ResizeDownMask)
- rd->ydelta = rd->height - rd->ydelta;
+ rd->xdelta = rd->ydelta = 0;
if (rd->resizeMode != ResizeModeNormal)
rd->lastWidth = rd->lastHeight = 0.0f;
@@ -506,19 +499,28 @@ static Bool resizeInitiate (CompDisplay *d,
CompWindowGrabButtonMask);
if (state & CompActionStateInitKey) {
- xRoot = w->attrib.x + (w->width / 2);
- yRoot = w->attrib.y + (w->height / 2);
- warpPointer (d, xRoot - d->pointerX, yRoot - d->pointerY);
+ x = w->attrib.x + (w->width / 2);
+ y = w->attrib.y + (w->height / 2);
+ warpPointer (d, x - d->pointerX, y - d->pointerY);
} else if ((mods & WARP_IGNORE_MASK) == mods_sought &&
button == button_sought &&
rd->opt[RESIZE_DISPLAY_OPTION_WARP_POINTER].value.b) {
/* May warp if initiated with mouse combo */
- xRoot = w->attrib.x - w->input.left +
+ x = w->attrib.x - w->input.left +
((mask & ResizeLeftMask) ? 0 : rd->width+w->input.left+w->input.right);
- yRoot = w->attrib.y - w->input.top +
+ y = w->attrib.y - w->input.top +
((mask & ResizeUpMask) ? 0 : rd->height+w->input.top+w->input.bottom);
- warpPointer (d, xRoot - d->pointerX, yRoot - d->pointerY);
+ warpPointer (d, x - d->pointerX, y - d->pointerY);
}
+
+ rd->xdelta = (x - rd->currentX);
+ if (rd->mask & ResizeRightMask)
+ rd->xdelta = rd->width - rd->xdelta;
+
+ rd->ydelta = (y - rd->currentY);
+ if (rd->mask & ResizeDownMask)
+ rd->ydelta = rd->height - rd->ydelta;
+
}
return FALSE;