From 360f96b5fd0d678e1dd27f047d3507a8b77b88de Mon Sep 17 00:00:00 2001 From: Nikos Ntarmos Date: Fri, 9 Nov 2007 19:22:42 +0100 Subject: [PATCH] stop centering mouse on move, just keep current coords --- client.c | 7 +++++-- event.c | 3 +-- tag.c | 5 ++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/client.c b/client.c index 3c38d47d..9b1a3aa0 100644 --- a/client.c +++ b/client.c @@ -442,8 +442,11 @@ client_resize(Client *c, int x, int y, int w, int h, awesome_config *awesomeconf { c->rx = c->x; c->ry = c->y; - c->rw = c->w; - c->rh = c->h; + if (c->w != w || c->h != h) + { + c->rw = c->w; + c->rh = c->h; + } } wc.border_width = c->border; XConfigureWindow(c->display, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc); diff --git a/event.c b/event.c index f7a07db0..cf76bdac 100644 --- a/event.c +++ b/event.c @@ -55,7 +55,6 @@ 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(;;) { @@ -206,7 +205,7 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf) if((get_current_layout(awesomeconf[c->screen].tags, awesomeconf[c->screen].ntags)->arrange != layout_floating) && !c->isfloating) - uicb_togglefloating(&awesomeconf[c->screen], NULL); + uicb_togglefloating(&awesomeconf[c->screen], "DUMMY"); else restack(&awesomeconf[c->screen]); movemouse(c, awesomeconf); diff --git a/tag.c b/tag.c index b2ee623a..1bf9efa0 100644 --- a/tag.c +++ b/tag.c @@ -177,7 +177,10 @@ uicb_togglefloating(awesome_config * awesomeconf, sel->isfloating = !sel->isfloating; - client_resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, awesomeconf, True, False); + if (arg == NULL) + client_resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, awesomeconf, True, False); + else + client_resize(sel, sel->x, sel->y, sel->w, sel->h, awesomeconf, True, True); client_untab(sel); saveprops(sel, awesomeconf->ntags);