From eabbd371a598f693ae28be122f93509ede1290eb Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 31 Oct 2007 14:27:28 +0100 Subject: [PATCH] events: warp and center in window pointer when moving with mouse --- event.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/event.c b/event.c index 99d732f82..7abb4af9c 100644 --- a/event.c +++ b/event.c @@ -40,7 +40,7 @@ #define MOUSEMASK (BUTTONMASK | PointerMotionMask) static void -movemouse(Client * c, awesome_config *awesomeconf) +movemouse(Client *c, awesome_config *awesomeconf) { int x1, y1, ocx, ocy, di, nx, ny; unsigned int dui; @@ -55,6 +55,7 @@ movemouse(Client * c, awesome_config *awesomeconf) if(XGrabPointer(c->display, RootWindow(c->display, c->phys_screen), False, MOUSEMASK, GrabModeAsync, GrabModeAsync, None, awesomeconf[c->screen].cursor[CurMove], CurrentTime) != GrabSuccess) return; + XWarpPointer(c->display, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2); XQueryPointer(c->display, RootWindow(c->display, c->phys_screen), &dummy, &dummy, &x1, &y1, &di, &di, &dui); for(;;) {