Add an ismoving attribute to client to fix a bug with titlebar and mouse moving in Xinerama

This commit is contained in:
Julien Danjou 2008-03-16 17:51:46 +01:00
parent a42d43a853
commit bb0fab396f
3 changed files with 9 additions and 5 deletions

View File

@ -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)

View File

@ -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

View File

@ -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 */