diff -ur fspanel-0.6/fspanel.c fspanel-0.6.my/fspanel.c --- fspanel-0.6/fspanel.c Tue Mar 20 13:16:05 2001 +++ fspanel-0.6.my/fspanel.c Fri May 11 17:28:06 2001 @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -261,6 +262,9 @@ add_task (taskbar * tb, Window win, int focus) { task *tk, *list; + XTextProperty text_prop; + char **plist; + int pnum; /* is this window on a different desktop? */ if (tb->my_desktop != find_desktop (win) || is_hidden (win)) @@ -269,7 +273,33 @@ tk = calloc (1, sizeof (task)); tk->win = win; tk->focused = focus; - tk->name = get_prop_data (tk->win, atom_WM_NAME, XA_STRING, 0); + + //proper way to get window name: + if(XGetWMName(dd, tk->win, &text_prop)) { + if (text_prop.value && text_prop.nitems > 0) { + if (text_prop.encoding == XA_STRING) { + tk->name = strdup((char *)text_prop.value); + XFree(text_prop.value); + } else { + text_prop.nitems = strlen((char *)text_prop.value); + if (XmbTextPropertyToTextList(dd, &text_prop, &plist, &pnum) >= Success && pnum > 0 && *plist) { + XFree(text_prop.value); + tk->name = strdup(*plist); + XFreeStringList(plist); + } else { + tk->name = strdup((char *)text_prop.value); + XFree(text_prop.value); + } + } + } else { + /* the title is set, but it was set to none */ + tk->name = strdup(""); + } + } else { + /* the hint is probably not set */ + tk->name = NULL; + } + tk->iconified = is_iconified (tk->win); get_task_kdeicon (tk); @@ -953,6 +983,7 @@ struct tm *lt; task *tk; + setlocale(LC_ALL,""); dd = XOpenDisplay (NULL); if (!dd) return 0;