summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/resize.c
diff options
context:
space:
mode:
authormaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-11-13 09:23:50 +0000
committermaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-11-13 09:23:50 +0000
commitce9ae9be10d9e0e35745a14e831cfbb6d61c7317 (patch)
tree9c7800d102b037a043420e20248ddf5db799931d /beryl-plugins/src/resize.c
parentb42cf91e77a7da9e2bd453351f9ad8220a30160a (diff)
downloadmarex-dev-ce9ae9be10d9e0e35745a14e831cfbb6d61c7317.tar.gz
marex-dev-ce9ae9be10d9e0e35745a14e831cfbb6d61c7317.tar.bz2
resize plugin: update position delta on keyboard invocation (closes #863)
git-svn-id: file:///beryl/trunk@1161 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/resize.c')
-rw-r--r--beryl-plugins/src/resize.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/beryl-plugins/src/resize.c b/beryl-plugins/src/resize.c
index d6c93d1..32a2888 100644
--- a/beryl-plugins/src/resize.c
+++ b/beryl-plugins/src/resize.c
@@ -619,8 +619,18 @@ static void resizeHandleKeyEvent (CompScreen *s, KeyCode keycode)
x = left + width * (rKeys[i].dx + 1) / 2;
y = top + height * (rKeys[i].dy + 1) / 2;
- warpPointer (s->display, x - s->display->pointerX, y - s->display->pointerY);
rd->mask = rKeys[i].resizeMask;
+
+ /* recalculate delta */
+ 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;
+
+ warpPointer (s->display, x - s->display->pointerX, y - s->display->pointerY);
updateScreenGrab (s, rs->grabIndex, rs->cursor[i]);
}