From ba5202b9f566198e04de7e6724a9293d316a16c8 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Sun, 22 Mar 2009 22:07:13 +0100 Subject: [PATCH] Wmfs: Simplify code and fix some things. --- src/frame.c | 11 ++++------- src/tag.c | 9 ++++++++- wmfsrc | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/frame.c b/src/frame.c index 9aa6478..f55f768 100644 --- a/src/frame.c +++ b/src/frame.c @@ -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) { diff --git a/src/tag.c b/src/tag.c index 289582a..4011d1b 100644 --- a/src/tag.c +++ b/src/tag.c @@ -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); diff --git a/wmfsrc b/wmfsrc index c14b480..bed502f 100644 --- a/wmfsrc +++ b/wmfsrc @@ -96,7 +96,7 @@ client titlebar { stipple = false - height = 11 + height = 12 fg_normal = "#7E89A2" fg_focus = "#9F9AB3"