Преглед изворни кода

Block refresh for multi statusline per barwin

Martin Duquesnoy пре 12 година
родитељ
комит
c23615271a
3 измењених фајлова са 6 додато и 1 уклоњено
  1. 2 0
      src/infobar.c
  2. 2 1
      src/status.c
  3. 2 0
      src/wmfs.h

+ 2 - 0
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)

+ 2 - 1
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))

+ 2 - 0
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;