diff -Naur tabbed-0.3/tabbed.c tabbed-mb-fix//tabbed.c --- tabbed-0.3/tabbed.c 2010-11-26 20:25:42.414423844 +0100 +++ tabbed-mb-fix//tabbed.c 2010-11-26 20:26:30.497757177 +0100 @@ -108,6 +108,7 @@ static unsigned long getcolor(const char *colstr); static Client *getfirsttab(); static Bool gettextprop(Window w, Atom atom, char *text, unsigned int size); +static Bool settextprop(Window w, Atom atom, char *text); static void initfont(const char *fontstr); static Bool isprotodel(Client *c); static void keypress(const XEvent *e); @@ -474,6 +475,21 @@ return True; } +Bool +settextprop(Window w, Atom atom, char *text) { + XTextProperty name; + + if(!text) + return False; + if(XmbTextListToTextProperty(dpy, &text, 1, XStdICCTextStyle, &name) != Success) + return False; + + XSetTextProperty(dpy, w, &name, atom); + XFree(name.value); + + return True; +} + void initfont(const char *fontstr) { char *def, **missing; @@ -822,8 +838,10 @@ void updatetitle(Client *c) { gettextprop(c->win, XA_WM_NAME, c->name, sizeof c->name); - if(sel == c) - XStoreName(dpy, win, c->name); + if(sel == c) { + if (settextprop(win, XA_WM_NAME, c->name) == False) + XStoreName(dpy, win, c->name); + } drawbar(); }