summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/resize.c
diff options
context:
space:
mode:
authormaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-11-26 08:58:43 +0000
committermaniac <maniac@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-11-26 08:58:43 +0000
commite4f7b9137b5db55109bb8c9efc8b517e6535bbbe (patch)
tree5ea5c7bf24b3ca3ed31fe454863e0b5714be7b91 /beryl-plugins/src/resize.c
parent7d5a47c487099e5b37f0c86cae78435e62b2423a (diff)
downloadmarex-dev-e4f7b9137b5db55109bb8c9efc8b517e6535bbbe.tar.gz
marex-dev-e4f7b9137b5db55109bb8c9efc8b517e6535bbbe.tar.bz2
resize plugin: also correctly restrict pointer movement on window constraint hit for left/up resize
git-svn-id: file:///beryl/trunk@1428 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/resize.c')
-rw-r--r--beryl-plugins/src/resize.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/beryl-plugins/src/resize.c b/beryl-plugins/src/resize.c
index 1d0bc9b..06e4d2d 100644
--- a/beryl-plugins/src/resize.c
+++ b/beryl-plugins/src/resize.c
@@ -350,7 +350,19 @@ static void resizeUpdateWindowSize (CompDisplay *d, int dx, int dy)
{
/* if the resizing hit constraints, move the mouse
pointer to the new border to avoid desynchronization */
- warpPointer (d, new_width - w, new_height - h);
+ int pointerAdjustX = 0, pointerAdjustY = 0;
+
+ if (rd->mask & ResizeRightMask)
+ pointerAdjustX = new_width - w;
+ else if (rd->mask & ResizeLeftMask)
+ pointerAdjustX = w - new_width;
+
+ if (rd->mask & ResizeDownMask)
+ pointerAdjustY = new_height - h;
+ else if (rd->mask & ResizeUpMask)
+ pointerAdjustY = h - new_height;
+
+ warpPointer (d, pointerAdjustX, pointerAdjustY);
}
dx -= new_width - w;