Fix configureevent for free mode apps-integrated mouse resize, and simplify some code

This commit is contained in:
Martin Duquesnoy 2012-01-29 04:59:34 +01:00
parent 1b31caac9e
commit 3361a3b8bc
3 changed files with 9 additions and 13 deletions

View File

@ -137,13 +137,8 @@ client_gb_pos(struct tag *t, int x, int y)
struct client *c = SLIST_FIRST(&t->clients);
FOREACH_NFCLIENT(c, &t->clients, tnext)
{
if(c->flags & CLIENT_FREE)
continue;
if(INAREA(x, y, c->geo))
return c;
}
return NULL;
}

View File

@ -161,9 +161,9 @@ event_configureevent(XEvent *e)
if(c->flags & CLIENT_FREE)
{
if(ev->value_mask & CWX)
c->geo.x = ev->x;
c->geo.x = ev->x - c->border;
if(ev->value_mask & CWY)
c->geo.y = ev->y;
c->geo.y = ev->y - c->tbarw;
if(ev->value_mask & CWWidth)
c->geo.w = ev->width + c->border + c->border;
if(ev->value_mask & CWHeight)

View File

@ -364,6 +364,7 @@ void
layout_split_integrate(struct client *c, struct client *sc)
{
struct geo g;
bool f;
/* No sc or not compatible sc */
if(!sc || sc == c || sc->tag != c->tag
@ -374,14 +375,14 @@ layout_split_integrate(struct client *c, struct client *sc)
* maximize the lonely client
*/
FOREACH_NFCLIENT(sc, &c->tag->clients, tnext)
{
if(sc == c || sc->flags & CLIENT_TABBED)
continue;
break;
}
if(sc != c && !(sc->flags & CLIENT_TABBED))
{
f = true;
break;
}
/* Ok there is no client to integrate in */
if(!sc)
if(!f)
{
client_maximize(c);
c->flags |= CLIENT_TILED;