Skip to content

Commit

Permalink
Merge pull request #6 from slobo/master
Browse files Browse the repository at this point in the history
Fix x-window-lis spewing garbage
  • Loading branch information
patrickhaller committed Oct 7, 2016
2 parents dfeca47 + b2c7839 commit 50015c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x-window-list.c
Expand Up @@ -47,9 +47,9 @@ void x_window_list(Config cfg, Display *dpy, Window *wins, unsigned int nwins) {
XClassHint hint;
w = viewables[i];

XGetClassHint(dpy, *w, &hint);
XGetWMName(dpy, *w, &name);
printf("%02d 0x%-12x %s - %s\n", i, (unsigned int)*w, hint.res_name, name.value);
char * res_name = XGetClassHint(dpy, *w, &hint) ? hint.res_name : "<>";
char * wm_name = XGetWMName(dpy, *w, &name) ? name.value : "<>";
printf("%02d 0x%-12x %s - %s\n", i, (unsigned int)*w, res_name, wm_name);
if (cfg.is_switch && i == cfg.dst) {
XRaiseWindow(dpy, *w);
XSetInputFocus(dpy, *w, RevertToPointerRoot, CurrentTime);
Expand Down

0 comments on commit 50015c8

Please sign in to comment.