From 533d9b30ef7a41c38d8470dcdabfb2e47a595d5e Mon Sep 17 00:00:00 2001 From: Sam Spilsbury Date: Thu, 3 Feb 2011 17:54:21 +0800 Subject: [PATCH 1/2] Take up/down pointer motions as left and right if the cursor is at a screen edge This allows the resize borders to extend past the window somewhat and for the user to still resize windows to the edge of the screen --- plugins/resize/src/resize.cpp | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/plugins/resize/src/resize.cpp b/plugins/resize/src/resize.cpp index 2d7ad86..e2283e7 100644 --- a/plugins/resize/src/resize.cpp +++ b/plugins/resize/src/resize.cpp @@ -834,6 +834,27 @@ ResizeScreen::handleMotionEvent (int xRoot, int yRoot) pointerDx += xRoot - lastPointerX; pointerDy += yRoot - lastPointerY; } + + /* If we hit the edge of the screen while resizing + * the window and the adjacent window edge has not hit + * the edge of the screen, then accumulate pointer motion + * in the opposite direction. (So the apparant x / y + * mixup here is intentional) + */ + + if (mask == ResizeLeftMask && + xRoot == grabWindowWorkArea->left ()) + pointerDx += abs (yRoot - lastPointerY) * -1; + else if (mask == ResizeRightMask && + xRoot == grabWindowWorkArea->right ()) + pointerDx += abs (yRoot - lastPointerY); + else if (mask == ResizeUpMask && + yRoot == grabWindowWorkArea->top ()) + pointerDy += abs (xRoot - lastPointerX); + else if (mask == ResizeUpMask && + yRoot == grabWindowWorkArea->bottom ()) + pointerDy += abs (xRoot - lastPointerX) * -1; + } if (mask & ResizeLeftMask) -- 1.7.2.3