summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Lyngstol <kristian@bohemians.org>2008-01-18 16:56:59 +0100
committerKristian Lyngstol <kristian@bohemians.org>2008-01-18 16:56:59 +0100
commitb8c1452d18460465fe2ac249e15f1ab90c067a7f (patch)
tree702a1bec3fbcc976fc01a5bfa02b7f5c36fc8670
parente595578f2be2f4f9e5f8d78130adc8eb5257b1ff (diff)
downloadshelf-b8c1452d18460465fe2ac249e15f1ab90c067a7f.tar.gz
shelf-b8c1452d18460465fe2ac249e15f1ab90c067a7f.tar.bz2
Improve move correctness - still not quite there
-rw-r--r--shelf.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/shelf.c b/shelf.c
index 825da91..764797c 100644
--- a/shelf.c
+++ b/shelf.c
@@ -46,6 +46,7 @@ typedef struct {
int grabIndex;
Cursor moveCursor;
Window grabbedWindow;
+ Bool noLastPointer;
int lastPointerX;
int lastPointerY;
PaintWindowProc paintWindow;
@@ -348,8 +349,9 @@ handleMotionEvent (CompDisplay *d, XEvent *event)
x = event->xmotion.x_root;
y = event->xmotion.y_root;
- if (ss->lastPointerX < 0)
+ if (ss->noLastPointer)
{
+ ss->noLastPointer = FALSE;
ss->lastPointerX = x;
ss->lastPointerY = y;
return;
@@ -372,8 +374,9 @@ handleButtonRelease (CompWindow *w)
ss->grabbedWindow = None;
if (ss->grabIndex)
{
- ss->lastPointerX = -1;
- ss->lastPointerY = -1;
+ ss->noLastPointer = TRUE;
+ ss->lastPointerX = 0;
+ ss->lastPointerY = 0;
moveInputFocusToWindow (w);
removeScreenGrab (s, ss->grabIndex, NULL);
ss->grabIndex = 0;
@@ -543,8 +546,9 @@ shelfInitScreen (CompPlugin *p,
ss->windowPrivateIndex = allocateWindowPrivateIndex (s);
s->base.privates[screenPrivateIndex].ptr = ss;
ss->moveCursor = XCreateFontCursor (s->display->display, XC_fleur);
- ss->lastPointerX = -1;
- ss->lastPointerY = -1;
+ ss->lastPointerX = 0;
+ ss->lastPointerY = 0;
+ ss->noLastPointer = TRUE;
WRAP (ss, s, preparePaintScreen, shelfPreparePaintScreen);
WRAP (ss, s, paintWindow, shelfPaintWindow);
WRAP (ss, s, damageWindowRect, shelfDamageWindowRect);