add a borders option to client_maximize() to (not) handle border removal
This commit is contained in:
parent
9865d44a88
commit
6701d0d2be
12
client.c
12
client.c
|
@ -851,12 +851,15 @@ uicb_client_kill(int screen __attribute__ ((unused)), char *arg __attribute__ ((
|
|||
}
|
||||
|
||||
void
|
||||
client_maximize(Client *c, int x, int y, int w, int h)
|
||||
client_maximize(Client *c, int x, int y, int w, int h, Bool borders)
|
||||
{
|
||||
if((c->ismax = !c->ismax))
|
||||
{
|
||||
if(borders)
|
||||
{
|
||||
c->oldborder = c->border;
|
||||
c->border = 0;
|
||||
}
|
||||
c->wasfloating = c->isfloating;
|
||||
c->isfloating = True;
|
||||
client_resize(c, x, y, w, h, False, True);
|
||||
|
@ -866,6 +869,7 @@ client_maximize(Client *c, int x, int y, int w, int h)
|
|||
else
|
||||
c->isfloating = False;
|
||||
|
||||
if(borders)
|
||||
c->border = c->oldborder;
|
||||
|
||||
arrange(c->screen);
|
||||
|
@ -886,7 +890,7 @@ uicb_client_togglemax(int screen, char *arg __attribute__ ((unused)))
|
|||
if(sel)
|
||||
client_maximize(sel, area.x, area.y,
|
||||
area.width - 2 * globalconf.screens[screen].borderpx,
|
||||
area.height - 2 * globalconf.screens[screen].borderpx);
|
||||
area.height - 2 * globalconf.screens[screen].borderpx, False);
|
||||
}
|
||||
|
||||
/** Toggle vertical maximize for client
|
||||
|
@ -905,7 +909,7 @@ uicb_client_toggleverticalmax(int screen, char *arg __attribute__ ((unused)))
|
|||
if(sel)
|
||||
client_maximize(sel, sel->x, area.y,
|
||||
sel->w,
|
||||
area.height - 2 * globalconf.screens[screen].borderpx);
|
||||
area.height - 2 * globalconf.screens[screen].borderpx, False);
|
||||
}
|
||||
|
||||
|
||||
|
@ -925,7 +929,7 @@ uicb_client_togglehorizontalmax(int screen, char *arg __attribute__ ((unused)))
|
|||
if(sel)
|
||||
client_maximize(sel, area.x, sel->y,
|
||||
area.height - 2 * globalconf.screens[screen].borderpx,
|
||||
sel->h);
|
||||
sel->h, False);
|
||||
}
|
||||
|
||||
/** Zoom client
|
||||
|
|
2
client.h
2
client.h
|
@ -40,7 +40,7 @@ void client_updatesizehints(Client *);
|
|||
void client_updatetitle(Client *);
|
||||
void client_saveprops(Client *);
|
||||
void client_kill(Client *);
|
||||
void client_maximize(Client *c, int, int, int, int);
|
||||
void client_maximize(Client *c, int, int, int, int, Bool);
|
||||
|
||||
Uicb uicb_client_kill;
|
||||
Uicb uicb_client_moveresize;
|
||||
|
|
2
ewmh.c
2
ewmh.c
|
@ -237,7 +237,7 @@ ewmh_process_state_atom(Client *c, Atom state, int set)
|
|||
c->ismax = True;
|
||||
else if(set == _NET_WM_STATE_ADD)
|
||||
c->ismax = False;
|
||||
client_maximize(c, area.x, area.y, area.width, area.height);
|
||||
client_maximize(c, area.x, area.y, area.width, area.height, True);
|
||||
}
|
||||
else
|
||||
printf("%s received unknown window state %s\n", c->name, XGetAtomName(globalconf.display, state));
|
||||
|
|
Loading…
Reference in New Issue