diff options
author | Joe <rbo@gmx.us> | 2024-12-19 15:06:27 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-12-19 15:06:27 +0100 |
commit | 03765f41f101502e9825047419fa9d8667e710ea (patch) | |
tree | cef6445d9c3df3081aed9f8cd28555ecfd88e401 /applied/dwm-6.0-winview.diff | |
parent | conflict (diff) | |
download | dwm-03765f41f101502e9825047419fa9d8667e710ea.tar.gz dwm-03765f41f101502e9825047419fa9d8667e710ea.tar.bz2 dwm-03765f41f101502e9825047419fa9d8667e710ea.tar.xz dwm-03765f41f101502e9825047419fa9d8667e710ea.tar.zst dwm-03765f41f101502e9825047419fa9d8667e710ea.zip |
6.5
Diffstat (limited to 'applied/dwm-6.0-winview.diff')
-rw-r--r-- | applied/dwm-6.0-winview.diff | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/applied/dwm-6.0-winview.diff b/applied/dwm-6.0-winview.diff new file mode 100644 index 0000000..1b796b5 --- /dev/null +++ b/applied/dwm-6.0-winview.diff @@ -0,0 +1,65 @@ +diff --git a/config.def.h b/config.def.h +index 77ff358..3ba0efe 100644 +--- a/config.def.h ++++ b/config.def.h +@@ -84,6 +84,7 @@ static Key keys[] = { + TAGKEYS( XK_8, 7) + TAGKEYS( XK_9, 8) + { MODKEY|ShiftMask, XK_q, quit, {0} }, ++ { MODKEY, XK_o, winview, {0} }, + }; + + /* button definitions */ +diff --git a/dwm.1 b/dwm.1 +index 5268a06..1188c82 100644 +--- a/dwm.1 ++++ b/dwm.1 +@@ -104,6 +104,9 @@ Increase master area size. + .B Mod1\-h + Decrease master area size. + .TP ++.B Mod1\-o ++Select view of the window in focus. The list of tags to be displayed is matched to the window tag list. ++.TP + .B Mod1\-Return + Zooms/cycles focused window to/from master area (tiled layouts only). + .TP +diff --git a/dwm.c b/dwm.c +index 1d78655..abf944c 100644 +--- a/dwm.c ++++ b/dwm.c +@@ -247,6 +247,7 @@ static void updatewmhints(Client *c); + static void view(const Arg *arg); + static Client *wintoclient(Window w); + static Monitor *wintomon(Window w); ++static void winview(const Arg* arg); + static int xerror(Display *dpy, XErrorEvent *ee); + static int xerrordummy(Display *dpy, XErrorEvent *ee); + static int xerrorstart(Display *dpy, XErrorEvent *ee); +@@ -2080,6 +2081,26 @@ wintomon(Window w) { + return selmon; + } + ++/* 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); ++} ++ + /* There's no way to check accesses to destroyed windows, thus those cases are + * ignored (especially on UnmapNotify's). Other types of errors call Xlibs + * default error handler, which may call exit. */ |