From bb0fab396fac87bfe25f69b231e8f606cb8f7d52 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 16 Mar 2008 17:51:46 +0100 Subject: [PATCH] Add an ismoving attribute to client to fix a bug with titlebar and mouse moving in Xinerama --- client.c | 4 ++-- mouse.c | 8 +++++--- structs.h | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/client.c b/client.c index 39d6328c..a6da4090 100644 --- a/client.c +++ b/client.c @@ -544,7 +544,7 @@ client_resize(Client *c, area_t geometry, Bool hints) if(hints) geometry = client_geometry_hints(c, geometry); - if(!c->isfloating && layout->arrange != layout_floating) + if(!c->ismoving && !c->isfloating && layout->arrange != layout_floating) geometry = titlebar_update_geometry(c, geometry); if(geometry.width <= 0 || geometry.height <= 0) @@ -577,7 +577,7 @@ client_resize(Client *c, area_t geometry, Bool hints) /* save the floating geometry if the window is floating but not * maximized */ - if(c->isfloating + if(c->ismoving || c->isfloating || layout_get_current(new_screen)->arrange == layout_floating) { if(!c->ismax) diff --git a/mouse.c b/mouse.c index 093bfb4a..c7ee7d27 100644 --- a/mouse.c +++ b/mouse.c @@ -73,6 +73,7 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused))) RootWindow(globalconf.display, phys_screen), &dummy, &dummy, &x, &y, &di, &di, &dui); c->ismax = False; + c->ismoving = True; for(;;) { XMaskEvent(globalconf.display, MOUSEMASK | ExposureMask | SubstructureRedirectMask, &ev); @@ -114,8 +115,6 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused))) geometry.height = c->geometry.height; client_resize(c, geometry, False); - - while(XCheckMaskEvent(globalconf.display, PointerMotionMask, &ev)); } else { @@ -126,7 +125,8 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused))) { move_client_to_screen(c, newscreen, True); globalconf.screens[c->screen].need_arrange = True; - globalconf.screens[newscreen].need_arrange = True; + if(layout_get_current(newscreen)->arrange != layout_floating) + globalconf.screens[newscreen].need_arrange = True; layout_refresh(); } if((target = client_get_bywin(globalconf.clients, child)) @@ -137,9 +137,11 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused))) layout_refresh(); } } + while(XCheckMaskEvent(globalconf.display, PointerMotionMask, &ev)); break; } } + c->ismoving = False; } /** Resize client with mouse diff --git a/structs.h b/structs.h index 6ceba009..6bd83a94 100644 --- a/structs.h +++ b/structs.h @@ -190,6 +190,8 @@ struct Client Bool ismax; /** True if the client must be skipped from client list */ Bool skip; + /** True if the client is moving */ + Bool ismoving; /** True if the client must be skipped from task bar client list */ Bool skiptb; /** Next and previous clients */