Add an ismoving attribute to client to fix a bug with titlebar and mouse moving in Xinerama
This commit is contained in:
parent
a42d43a853
commit
bb0fab396f
4
client.c
4
client.c
|
@ -544,7 +544,7 @@ client_resize(Client *c, area_t geometry, Bool hints)
|
||||||
if(hints)
|
if(hints)
|
||||||
geometry = client_geometry_hints(c, geometry);
|
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);
|
geometry = titlebar_update_geometry(c, geometry);
|
||||||
|
|
||||||
if(geometry.width <= 0 || geometry.height <= 0)
|
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
|
/* save the floating geometry if the window is floating but not
|
||||||
* maximized */
|
* maximized */
|
||||||
if(c->isfloating
|
if(c->ismoving || c->isfloating
|
||||||
|| layout_get_current(new_screen)->arrange == layout_floating)
|
|| layout_get_current(new_screen)->arrange == layout_floating)
|
||||||
{
|
{
|
||||||
if(!c->ismax)
|
if(!c->ismax)
|
||||||
|
|
6
mouse.c
6
mouse.c
|
@ -73,6 +73,7 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
|
||||||
RootWindow(globalconf.display, phys_screen),
|
RootWindow(globalconf.display, phys_screen),
|
||||||
&dummy, &dummy, &x, &y, &di, &di, &dui);
|
&dummy, &dummy, &x, &y, &di, &di, &dui);
|
||||||
c->ismax = False;
|
c->ismax = False;
|
||||||
|
c->ismoving = True;
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
XMaskEvent(globalconf.display, MOUSEMASK | ExposureMask | SubstructureRedirectMask, &ev);
|
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;
|
geometry.height = c->geometry.height;
|
||||||
|
|
||||||
client_resize(c, geometry, False);
|
client_resize(c, geometry, False);
|
||||||
|
|
||||||
while(XCheckMaskEvent(globalconf.display, PointerMotionMask, &ev));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -126,6 +125,7 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
|
||||||
{
|
{
|
||||||
move_client_to_screen(c, newscreen, True);
|
move_client_to_screen(c, newscreen, True);
|
||||||
globalconf.screens[c->screen].need_arrange = True;
|
globalconf.screens[c->screen].need_arrange = True;
|
||||||
|
if(layout_get_current(newscreen)->arrange != layout_floating)
|
||||||
globalconf.screens[newscreen].need_arrange = True;
|
globalconf.screens[newscreen].need_arrange = True;
|
||||||
layout_refresh();
|
layout_refresh();
|
||||||
}
|
}
|
||||||
|
@ -137,9 +137,11 @@ uicb_client_movemouse(int screen, char *arg __attribute__ ((unused)))
|
||||||
layout_refresh();
|
layout_refresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
while(XCheckMaskEvent(globalconf.display, PointerMotionMask, &ev));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
c->ismoving = False;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Resize client with mouse
|
/** Resize client with mouse
|
||||||
|
|
|
@ -190,6 +190,8 @@ struct Client
|
||||||
Bool ismax;
|
Bool ismax;
|
||||||
/** True if the client must be skipped from client list */
|
/** True if the client must be skipped from client list */
|
||||||
Bool skip;
|
Bool skip;
|
||||||
|
/** True if the client is moving */
|
||||||
|
Bool ismoving;
|
||||||
/** True if the client must be skipped from task bar client list */
|
/** True if the client must be skipped from task bar client list */
|
||||||
Bool skiptb;
|
Bool skiptb;
|
||||||
/** Next and previous clients */
|
/** Next and previous clients */
|
||||||
|
|
Loading…
Reference in New Issue