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