summaryrefslogtreecommitdiffhomepage
path: root/patch/winview.c
diff options
context:
space:
mode:
authorbakkeby <[email protected]>2019-09-15 23:33:43 +0200
committerbakkeby <[email protected]>2019-09-15 23:36:05 +0200
commitf60b0b5121fb68e4dbb76036ec3efd24fe6c904c (patch)
treedd4fdc54b94767c4853c7272a46088a95dc4dac9 /patch/winview.c
parentf8f67508d811e3ad92f159d5101e2da89e269e37 (diff)
downloaddwm-flexipatch-f60b0b5121fb68e4dbb76036ec3efd24fe6c904c.tar.gz
dwm-flexipatch-f60b0b5121fb68e4dbb76036ec3efd24fe6c904c.zip
Adding winview patch
Diffstat (limited to 'patch/winview.c')
-rw-r--r--patch/winview.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/patch/winview.c b/patch/winview.c
new file mode 100644
index 0000000..a73ee66
--- /dev/null
+++ b/patch/winview.c
@@ -0,0 +1,20 @@
+/* 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);
+} \ No newline at end of file