Wmfs: Simplify code and fix some things.

This commit is contained in:
Martin Duquesnoy 2009-03-22 22:07:13 +01:00
parent 0d60b5dd90
commit ba5202b9f5
3 changed files with 13 additions and 9 deletions

View File

@ -87,16 +87,12 @@ frame_create(Client *c)
for(i = 0; i < conf.titlebar.nbutton; ++i)
{
CWIN(c->button[i], c->titlebar->win,
(BORDH + (BUTTONWH * i) + (4 * i)),
(c->button_last_x = (BORDH + (BUTTONWH * i) + (4 * i))),
((BUTTONWH - 1) / 2), BUTTONWH, BUTTONWH,
1, CWEventMask|CWOverrideRedirect|CWBackPixmap,
c->colors.frame, &at);
XSetWindowBorder(dpy, c->button[i], getcolor(c->colors.fg));
/* Save the position of the last button to draw the font rectangle (frame_update) */
if(i == conf.titlebar.nbutton - 1)
c->button_last_x = (BORDH + (BUTTONWH * i) + (4 * i)) + TBARH;
}
}
}
@ -209,8 +205,9 @@ frame_update(Client *c)
/* Buttons */
if(conf.titlebar.nbutton && BUTTONWH >= 1)
{
draw_rectangle(c->titlebar->dr, 0, 0, c->button_last_x,
TBARH + BORDH * 2, c->colors.frame);
if(conf.titlebar.stipple)
draw_rectangle(c->titlebar->dr, 0, 0, c->button_last_x + TBARH,
TBARH + BORDH * 2, c->colors.frame);
for(i = 0; i < conf.titlebar.nbutton; ++i)
{

View File

@ -39,8 +39,12 @@
void
tag_set(int tag)
{
int otag;
screen_get_sel();
otag = seltag[selscreen];
if(!tag)
tag = 1;
@ -61,7 +65,10 @@ tag_set(int tag)
seltag[selscreen] = tag;
}
ewmh_get_current_desktop();
infobar_set_position(tags[selscreen][seltag[selscreen]].barpos);
if(tags[selscreen][otag].barpos != tags[selscreen][seltag[selscreen]].barpos)
infobar_set_position(tags[selscreen][seltag[selscreen]].barpos);
arrange(selscreen);
client_focus(NULL);

2
wmfsrc
View File

@ -96,7 +96,7 @@ client
titlebar
{
stipple = false
height = 11
height = 12
fg_normal = "#7E89A2"
fg_focus = "#9F9AB3"