Fix global fac resize when only one client is not resizable

This commit is contained in:
Martin Duquesnoy
2011-10-24 19:37:36 +02:00
parent f22f706415
commit cd058a4753
3 changed files with 17 additions and 7 deletions

View File

@@ -651,7 +651,7 @@ client_winsize(struct client *c, struct geo *g)
void void
client_moveresize(struct client *c, struct geo *g) client_moveresize(struct client *c, struct geo *g)
{ {
c->tgeo = c->rgeo = c->geo = *g; c->ttgeo = c->tgeo = c->rgeo = c->geo = *g;
if(!(c->flags & CLIENT_DID_WINSIZE)) if(!(c->flags & CLIENT_DID_WINSIZE))
if(client_winsize(c, g)) if(client_winsize(c, g))
@@ -683,8 +683,9 @@ client_moveresize(struct client *c, struct geo *g)
void void
client_maximize(struct client *c) client_maximize(struct client *c)
{ {
c->geo = c->screen->ugeo;
c->geo.x = c->geo.y = 0; c->geo.x = c->geo.y = 0;
c->geo.w = c->screen->ugeo.w;
c->geo.h = c->screen->ugeo.h;
client_moveresize(c, &c->geo); client_moveresize(c, &c->geo);
@@ -713,7 +714,7 @@ _fac_apply(struct client *c, enum position p, int fac)
break; break;
} }
c->flags |= CLIENT_IGNORE_ENTER; c->flags |= (CLIENT_IGNORE_ENTER | CLIENT_FAC_APPLIED);
} }
static inline void static inline void
@@ -737,6 +738,9 @@ _fac_resize(struct client *c, enum position p, int fac)
if(!gc || gc->screen != c->screen) if(!gc || gc->screen != c->screen)
return; return;
SLIST_FOREACH(cc, &c->tag->clients, tnext)
cc->ttgeo = cc->tgeo;
if(GEO_CHECK2(c->geo, gc->geo, p)) if(GEO_CHECK2(c->geo, gc->geo, p))
{ {
_fac_apply(c, p, fac); _fac_apply(c, p, fac);
@@ -755,7 +759,8 @@ _fac_resize(struct client *c, enum position p, int fac)
* clients in linked list. * clients in linked list.
*/ */
SLIST_FOREACH(gc, &c->tag->clients, tnext) SLIST_FOREACH(gc, &c->tag->clients, tnext)
if(client_winsize(gc, &gc->tgeo)) if(gc->flags & CLIENT_FAC_APPLIED
&& client_winsize(gc, &gc->tgeo))
{ {
/* /*
* Reverse back the flag and the window geo * Reverse back the flag and the window geo
@@ -763,12 +768,13 @@ _fac_resize(struct client *c, enum position p, int fac)
*/ */
SLIST_FOREACH(cc, &c->tag->clients, tnext) SLIST_FOREACH(cc, &c->tag->clients, tnext)
{ {
cc->tgeo = cc->geo; cc->tgeo = cc->ttgeo;
cc->flags &= ~CLIENT_DID_WINSIZE; cc->flags &= ~CLIENT_DID_WINSIZE;
} }
return; return;
} }
} }
#define _REV_BORDER() \ #define _REV_BORDER() \
@@ -849,7 +855,10 @@ client_fac_resize(struct client *c, enum position p, int fac)
if(b) if(b)
{ {
SLIST_FOREACH(gc, &c->tag->clients, tnext) SLIST_FOREACH(gc, &c->tag->clients, tnext)
{
client_moveresize(gc, &gc->tgeo); client_moveresize(gc, &gc->tgeo);
gc->flags &= ~CLIENT_FAC_APPLIED;
}
layout_save_set(c->tag); layout_save_set(c->tag);
} }

View File

@@ -48,7 +48,7 @@ event_enternotify(XEvent *e)
if((c = client_gb_win(ev->window)) if((c = client_gb_win(ev->window))
|| (c = client_gb_frame(ev->window))) || (c = client_gb_frame(ev->window)))
{ {
if(c->flags & CLIENT_IGNORE_ENTER) if(c->flags & CLIENT_IGNORE_ENTER)
c->flags ^= CLIENT_IGNORE_ENTER; c->flags ^= CLIENT_IGNORE_ENTER;
else else

View File

@@ -143,7 +143,7 @@ struct client
struct tag *tag; struct tag *tag;
struct screen *screen; struct screen *screen;
struct barwin *titlebar; struct barwin *titlebar;
struct geo geo, wgeo, tgeo, rgeo; struct geo geo, wgeo, tgeo, ttgeo, rgeo;
struct colpair ncol, scol; struct colpair ncol, scol;
int sizeh[SHLAST]; int sizeh[SHLAST];
char *title; char *title;
@@ -151,6 +151,7 @@ struct client
#define CLIENT_HINT_FLAG 0x01 #define CLIENT_HINT_FLAG 0x01
#define CLIENT_IGNORE_ENTER 0x02 #define CLIENT_IGNORE_ENTER 0x02
#define CLIENT_DID_WINSIZE 0x04 #define CLIENT_DID_WINSIZE 0x04
#define CLIENT_FAC_APPLIED 0x08
Flags flags; Flags flags;
Window win, frame; Window win, frame;
SLIST_ENTRY(client) next; /* Global list */ SLIST_ENTRY(client) next; /* Global list */