diff options
Diffstat (limited to 'patch/winview.c')
| -rw-r--r-- | patch/winview.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/patch/winview.c b/patch/winview.c new file mode 100644 index 0000000..f54c20c --- /dev/null +++ b/patch/winview.c @@ -0,0 +1,21 @@ +/* Selects for the view of the focused window. The list of tags */ +/* to be displayed is matched to the focused window tag list. */ +void +winview(const Arg* arg) +{ + Window win, win_r, win_p, *win_c; + unsigned nc; + int unused; + Client* c; + Arg a; + + if (!XGetInputFocus(dpy, &win, &unused)) return; + while (XQueryTree(dpy, win, &win_r, &win_p, &win_c, &nc) + && win_p != win_r) win = win_p; + + if (!(c = wintoclient(win))) return; + + a.ui = c->tags; + view(&a); +} + |
