[wmfs.c] Remove memcmp for layoutswitch, improve...
This commit is contained in:
32
wmfs.c
32
wmfs.c
@@ -148,8 +148,10 @@ freelayout(void)
|
|||||||
if(!ishide(c))
|
if(!ishide(c))
|
||||||
{
|
{
|
||||||
if(c->tile)
|
if(c->tile)
|
||||||
|
{
|
||||||
moveresize(c, c->ox, c->oy, c->ow, c->oh, True);
|
moveresize(c, c->ox, c->oy, c->ow, c->oh, True);
|
||||||
c->tile = False;
|
c->tile = False;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -450,6 +452,7 @@ killclient(char *cmd)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Improved ! :) */
|
||||||
void
|
void
|
||||||
layoutswitch(char *cmd)
|
layoutswitch(char *cmd)
|
||||||
{
|
{
|
||||||
@@ -457,12 +460,13 @@ layoutswitch(char *cmd)
|
|||||||
|
|
||||||
for(i = 0; i < NLAYOUT; ++i)
|
for(i = 0; i < NLAYOUT; ++i)
|
||||||
{
|
{
|
||||||
if(!memcmp(&tags[seltag].layout, &lyt[i], sizeof(Layout)))
|
if(tags[seltag].layout.symbol == lyt[i].symbol
|
||||||
|
&& tags[seltag].layout.func == lyt[i].func)
|
||||||
{
|
{
|
||||||
if(cmd[0] == '+')
|
if(cmd[0] == '+')
|
||||||
tags[seltag].layout = lyt[((i + 1 < NLAYOUT) ? i + 1 : 0)];
|
tags[seltag].layout = lyt[(i + 1) % NLAYOUT];
|
||||||
else if(cmd[0] == '-')
|
else if(cmd[0] == '-')
|
||||||
tags[seltag].layout = lyt[((i - 1 > -1) ? i - 1 : NLAYOUT-1)];
|
tags[seltag].layout = lyt[(i + NLAYOUT - 1) % NLAYOUT];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -471,22 +475,6 @@ layoutswitch(char *cmd)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
lowerclient(Client *c)
|
|
||||||
{
|
|
||||||
if(!c)
|
|
||||||
return;
|
|
||||||
if(conf.ttbarheight)
|
|
||||||
{
|
|
||||||
if(conf.ttbarheight > 5)
|
|
||||||
XLowerWindow(dpy,c->button);
|
|
||||||
XLowerWindow(dpy,c->tbar);
|
|
||||||
}
|
|
||||||
XLowerWindow(dpy,c->win);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
mainloop(void)
|
mainloop(void)
|
||||||
{
|
{
|
||||||
@@ -584,7 +572,9 @@ manage(Window w, XWindowAttributes *wa)
|
|||||||
|
|
||||||
if(conf.ttbarheight > 5)
|
if(conf.ttbarheight > 5)
|
||||||
c->button = XCreateSimpleWindow(dpy, root, BUTX(c->x, c->w),
|
c->button = XCreateSimpleWindow(dpy, root, BUTX(c->x, c->w),
|
||||||
BUTY(c->y), (BUTH) ? BUTH : 1, (BUTH) ? BUTH : 1,
|
BUTY(c->y),
|
||||||
|
((BUTH) ? BUTH : 1),
|
||||||
|
((BUTH) ? BUTH : 1),
|
||||||
1, conf.colors.bordernormal,
|
1, conf.colors.bordernormal,
|
||||||
conf.colors.borderfocus);
|
conf.colors.borderfocus);
|
||||||
}
|
}
|
||||||
|
|||||||
1
wmfs.h
1
wmfs.h
@@ -231,7 +231,6 @@ void keymovey(char *cmd);
|
|||||||
void keyresize(char *cmd);
|
void keyresize(char *cmd);
|
||||||
void killclient(char *cmd);
|
void killclient(char *cmd);
|
||||||
void layoutswitch(char *cmd);
|
void layoutswitch(char *cmd);
|
||||||
void lowerclient(Client *c);
|
|
||||||
void mainloop(void);
|
void mainloop(void);
|
||||||
void mapclient(Client *c);
|
void mapclient(Client *c);
|
||||||
void manage(Window w, XWindowAttributes *wa);
|
void manage(Window w, XWindowAttributes *wa);
|
||||||
|
|||||||
Reference in New Issue
Block a user