From c23615271afad3f1b343b22243f2fc0685f0eafe Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Mon, 6 Feb 2012 11:40:04 +0100 Subject: [PATCH] Block refresh for multi statusline per barwin --- src/infobar.c | 2 ++ src/status.c | 3 ++- src/wmfs.h | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/infobar.c b/src/infobar.c index f560b53..c679e76 100644 --- a/src/infobar.c +++ b/src/infobar.c @@ -61,6 +61,7 @@ infobar_elem_tag_init(struct element *e) e->geo.h -= (e->infobar->theme->tags_border_width << 1); e->statusctx = &e->infobar->theme->tags_n_sl; + e->statusctx->flags |= STATUS_BLOCK_REFRESH; if(SLIST_EMPTY(&e->bars) || (e->infobar->screen->flags & SCREEN_TAG_UPDATE)) { @@ -79,6 +80,7 @@ infobar_elem_tag_init(struct element *e) /* Status doesn't have theme yet */ t->statusctx.theme = e->infobar->theme; + t->statusctx.flags |= STATUS_BLOCK_REFRESH; /* Set border */ if(e->infobar->theme->tags_border_width) diff --git a/src/status.c b/src/status.c index 4cecb80..44241aa 100644 --- a/src/status.c +++ b/src/status.c @@ -453,7 +453,8 @@ status_render(struct status_ctx *ctx) if(!ctx->status) return; - barwin_refresh_color(ctx->barwin); + if(!(ctx->flags & STATUS_BLOCK_REFRESH)) + barwin_refresh_color(ctx->barwin); /* Use simple text instead sequence if no sequence found */ if(SLIST_EMPTY(&ctx->statushead)) diff --git a/src/wmfs.h b/src/wmfs.h index e7b2cce..9a689bf 100644 --- a/src/wmfs.h +++ b/src/wmfs.h @@ -113,6 +113,8 @@ struct status_ctx { struct barwin *barwin; struct theme *theme; +#define STATUS_BLOCK_REFRESH 0x01 + Flags flags; char *status; bool update; SLIST_HEAD(, status_gcache) gcache;