Browse Source

Avoid cc->title = NULL case using draw_text in frame_update

Martin Duquesnoy 12 years ago
parent
commit
a9b5542513
4 changed files with 7 additions and 4 deletions
  1. 5 3
      src/client.c
  2. 1 0
      src/ewmh.c
  3. 1 0
      src/ewmh.h
  4. 0 1
      src/launcher.c

+ 5 - 3
src/client.c

@@ -425,10 +425,12 @@ client_frame_update(struct client *c, struct colpair *cp)
      {
           struct geo g = { f - 1, 0, 1, c->titlebar->geo.h };
           int x = c->border;
+          char *title;
 
           SLIST_FOREACH(cc, &c->tag->clients, tnext)
           {
-               w = (cc->title ? draw_textw(c->theme, cc->title) : 0);
+               title = (cc->title ? cc->title : "WMFS");
+               w = draw_textw(c->theme, title);
                _XTEXT();
 
                if(cc == c)
@@ -443,7 +445,7 @@ client_frame_update(struct client *c, struct colpair *cp)
 
                     _STATUSLINE(c, true);
                     draw_rect(c->titlebar->dr, &g, c->scol.bg);
-                    draw_text(c->titlebar->dr, c->theme, xt, y, cp->fg, c->title);
+                    draw_text(c->titlebar->dr, c->theme, xt, y, cp->fg, title);
                     barwin_refresh(c->titlebar);
 
                     x += f;
@@ -461,7 +463,7 @@ client_frame_update(struct client *c, struct colpair *cp)
 
                     _STATUSLINE(cc, false);
                     draw_rect(cc->titlebar->dr, &g, c->scol.bg);
-                    draw_text(cc->titlebar->dr, c->theme, xt, y - 1, c->ncol.fg, cc->title);
+                    draw_text(cc->titlebar->dr, c->theme, xt, y - 1, c->ncol.fg, title);
                     barwin_refresh(cc->titlebar);
 
                     x += f;

+ 1 - 0
src/ewmh.c

@@ -49,6 +49,7 @@ ewmh_init(void)
      W->net_atom[net_wm_state_fullscreen]        = ATOM("_NET_WM_STATE_FULLSCREEN");
      W->net_atom[net_wm_state_sticky]            = ATOM("_NET_WM_STATE_STICKY");
      W->net_atom[net_wm_state_demands_attention] = ATOM("_NET_WM_STATE_DEMANDS_ATTENTION");
+     W->net_atom[net_wm_state_hidden]            = ATOM("_NET_WM_STATE_HIDDEN");
      W->net_atom[net_system_tray_s]              = ATOM("_NET_SYSTEM_TRAY_S0");
      W->net_atom[net_system_tray_opcode]         = ATOM("_NET_SYSTEM_TRAY_OPCODE");
      W->net_atom[net_system_tray_message_data]   = ATOM("_NET_SYSTEM_TRAY_MESSAGE_DATA");

+ 1 - 0
src/ewmh.h

@@ -68,6 +68,7 @@ enum
      net_wm_state_fullscreen,
      net_wm_state_sticky,
      net_wm_state_demands_attention,
+     net_wm_state_hidden,
      net_system_tray_opcode,
      net_system_tray_message_data,
      net_system_tray_s,

+ 0 - 1
src/launcher.c

@@ -215,7 +215,6 @@ complete(struct launcher_ccache *cache, char *start)
                cache->namelist = complete_on_command(p);
           else
                cache->namelist = complete_on_files(p);
-
      }
 
      if(cache->namelist && cache->namelist[cache->hits])