diff options
| -rw-r--r-- | x-window-list.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/x-window-list.c b/x-window-list.c index 208d75a..7306c9b 100644 --- a/x-window-list.c +++ b/x-window-list.c @@ -27,7 +27,9 @@ void x_window_list(Config cfg, Display *dpy, Window *wins, unsigned int nwins) { XTextProperty name; XClassHint hint; - if (!XGetWindowAttributes(dpy, *w, &attr)) + if (! XGetWMHints(dpy, *w)) + continue; + if (! XGetWindowAttributes(dpy, *w, &attr)) continue; if (attr.override_redirect) continue; @@ -38,8 +40,11 @@ void x_window_list(Config cfg, Display *dpy, Window *wins, unsigned int nwins) { XGetClassHint(dpy, *w, &hint); XGetWMName(dpy, *w, &name); - - printf("0x%-12x %s - %s\n",(unsigned int)*w, hint.res_name, name.value); + printf("0x%-12x %s %s - %s\n", + (unsigned int)*w, + attr.map_state == IsUnmapped ? "U":"M", + hint.res_name, name.value + ); } } |
