Client/Event/Tag: Fix XUrgencyHint support

This commit is contained in:
Martin Duquesnoy
2010-04-04 15:42:51 +02:00
parent 9c154fd0f3
commit ee13255297
5 changed files with 16 additions and 13 deletions

View File

@@ -271,6 +271,7 @@ client_focus(Client *c)
if(c->flags & UrgentFlag) if(c->flags & UrgentFlag)
{ {
c->flags &= ~UrgentFlag; c->flags &= ~UrgentFlag;
tags[c->screen][c->tag].urgent = False;
infobar_draw_taglist(c->screen); infobar_draw_taglist(c->screen);
} }

View File

@@ -396,7 +396,7 @@ conf_tag_section(char *src)
* MAXTAG (32) print an error and create only one. * MAXTAG (32) print an error and create only one.
*/ */
Tag default_tag = { "WMFS", NULL, 0, 1, Tag default_tag = { "WMFS", NULL, 0, 1,
0.50, 1, False, False, False, IB_Top, 0.50, 1, False, False, False, False, IB_Top,
layout_name_to_struct(conf.layout, "tile_right", conf.nlayout, layout_list) }; layout_name_to_struct(conf.layout, "tile_right", conf.nlayout, layout_list) };
cfg_set_sauv(src); cfg_set_sauv(src);

View File

@@ -477,12 +477,12 @@ propertynotify(XPropertyEvent *ev)
client_size_hints(c); client_size_hints(c);
break; break;
case XA_WM_HINTS: case XA_WM_HINTS:
if((h = XGetWMHints(dpy, c->win)) && (h->flags & XUrgencyHint)) if((h = XGetWMHints(dpy, c->win)) && (h->flags & XUrgencyHint) && c != sel)
{ {
c->flags |= UrgentFlag; c->flags |= UrgentFlag;
if(ishide(c, selscreen)) tags[c->screen][c->tag].urgent = True;
infobar_draw_taglist(c->screen); infobar_draw_taglist(c->screen);
XFree(h); XFree(h);
} }

View File

@@ -208,23 +208,24 @@ infobar_draw_taglist(int sc)
barwin_refresh_color(infobar[sc].tags[i]); barwin_refresh_color(infobar[sc].tags[i]);
/* Colorize a tag if there are clients in this or in urgent case */ /* Colorize a tag if there are clients in this */
for(c = clients; c; c = c->next) for(c = clients; c; c = c->next)
{ {
if(c->screen == sc) if(c->screen == sc)
{ {
if(c->tag == i && (c->flags & UrgentFlag) && c->tag != seltag[sc]) infobar[sc].tags[c->tag]->bg = ((c->tag == seltag[sc]) ? conf.colors.tagselbg : conf.colors.tag_occupied_bg);
{
infobar[sc].tags[i]->bg = conf.colors.tagurbg;
infobar[sc].tags[i]->fg = conf.colors.tagurfg;
}
else
infobar[sc].tags[c->tag]->bg = ((c->tag == seltag[sc]) ? conf.colors.tagselbg : conf.colors.tag_occupied_bg);
barwin_refresh_color(infobar[sc].tags[i]); barwin_refresh_color(infobar[sc].tags[i]);
} }
} }
if(tags[sc][i].urgent)
{
infobar[sc].tags[i]->bg = conf.colors.tagurbg;
infobar[sc].tags[i]->fg = conf.colors.tagurfg;
barwin_refresh_color(infobar[sc].tags[i]);
}
if(tags[sc][i].name) if(tags[sc][i].name)
barwin_draw_text(infobar[sc].tags[i], PAD / 2, FHINFOBAR, tags[sc][i].name); barwin_draw_text(infobar[sc].tags[i], PAD / 2, FHINFOBAR, tags[sc][i].name);
} }

View File

@@ -251,6 +251,7 @@ typedef struct
int layers; int layers;
float mwfact; float mwfact;
int nmaster; int nmaster;
Bool urgent;
Bool resizehint; Bool resizehint;
Bool request_update; Bool request_update;
Bool abovefc; Bool abovefc;