summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick <devnull@mailinator.com>2017-06-08 16:40:23 +0800
committerPatrick <devnull@mailinator.com>2017-06-08 16:41:17 +0800
commitb1fb8bef64d63e00d67be40b36e2c82a0c9d9dc7 (patch)
tree7657335bbf6e633fee5e0fce9a1ab3995a052fce
parent46a97b336e69ddbf73ed6e0d21fb909d48a214c3 (diff)
add filter out of unmanaged windows, add (un)mapped indicator to output
-rw-r--r--x-window-list.c11
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
+ );
}
}