From e5a804cee820e9cdd3540d0051d802d66c92e974 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Thu, 4 Aug 2011 09:18:32 +0200 Subject: [PATCH] Selbar: Dynamic selbar position is back --- src/infobar.c | 7 ++++--- src/layout.c | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/infobar.c b/src/infobar.c index 1a51c6a..f05f152 100644 --- a/src/infobar.c +++ b/src/infobar.c @@ -108,9 +108,6 @@ infobar_init(void) /* Selbar */ if(conf.bars.selbar) { - ib->selbar_geo.x = (conf.layout_placement - ? ib->tags_board->geo.x + ib->tags_board->geo.width + (PAD >> 1) - : ib->layout_button->geo.x + ib->layout_button->geo.width + (PAD >> 1)); ib->selbar_geo.y = 0; ib->selbar_geo.height = ib->geo.height; } @@ -230,6 +227,10 @@ infobar_draw_selbar(InfoBar *i) f = True; } + i->selbar_geo.x = (conf.layout_placement + ? i->tags_board->geo.x + i->tags_board->geo.width + (PAD >> 1) + : i->layout_button->geo.x + i->layout_button->geo.width + (PAD >> 1)); + XSetForeground(dpy, gc, conf.selbar.bg); XFillRectangle(dpy, i->bar->dr, gc, i->selbar_geo.x, 0, (i->selbar_geo.width = textw(str) + PAD), i->geo.height); draw_text(i->bar->dr, i->selbar_geo.x, FHINFOBAR - 1, conf.selbar.fg, str); diff --git a/src/layout.c b/src/layout.c index d7c6287..2c0fb0c 100644 --- a/src/layout.c +++ b/src/layout.c @@ -133,10 +133,12 @@ layoutswitch(bool b) } ewmh_update_current_tag_prop(); + tags[selscreen][seltag[selscreen]].flags |= CleanFactFlag; tags[selscreen][seltag[selscreen]].flags &= ~SplitFlag; + layout_func(selscreen, seltag[selscreen]); - infobar_draw_layout(&infobar[selscreen]); + infobar_draw(&infobar[selscreen]); return; }