[wiki] [sites] Added winview patch for dwm 6.1. Rephrased the patch description. || Philippe Gras

From: <git_AT_suckless.org>
Date: Sun, 13 Mar 2016 21:32:34 +0100

commit 1cb5e6249d0e1a397627f56259f6e715f77f927e
Author: Philippe Gras <philippe.gras_AT_free.fr>
Date: Sun Mar 13 21:26:01 2016 +0100

    Added winview patch for dwm 6.1. Rephrased the patch description.

diff --git a/dwm.suckless.org/patches/dwm-6.0-winview.diff b/dwm.suckless.org/patches/dwm-6.0-winview.diff
deleted file mode 100644
index 1b796b5..0000000
--- a/dwm.suckless.org/patches/dwm-6.0-winview.diff
+++ /dev/null
_AT_@ -1,65 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index 77ff358..3ba0efe 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -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
-_AT_@ -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
-_AT_@ -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);
-_AT_@ -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. */
diff --git a/dwm.suckless.org/patches/dwm-6.1-winview.diff b/dwm.suckless.org/patches/dwm-6.1-winview.diff
new file mode 100644
index 0000000..e69de29
diff --git a/dwm.suckless.org/patches/historical/dwm-6.0-winview.diff b/dwm.suckless.org/patches/historical/dwm-6.0-winview.diff
new file mode 100644
index 0000000..1b796b5
--- /dev/null
+++ b/dwm.suckless.org/patches/historical/dwm-6.0-winview.diff
_AT_@ -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
+_AT_@ -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
+_AT_@ -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
+_AT_@ -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);
+_AT_@ -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. */
diff --git a/dwm.suckless.org/patches/winview.md b/dwm.suckless.org/patches/winview.md
index cf8c7a2..cbd5a1f 100644
--- a/dwm.suckless.org/patches/winview.md
+++ b/dwm.suckless.org/patches/winview.md
_AT_@ -4,19 +4,20 @@ Winview
 Description
 -----------
 
-Adds a command to select the view of a window. The list of tags to be displayed
-is matched to the window tag list. This command is typically used from the
-all-window view.
+Dwm tags are a powerfull feature that allows organizing windows in
+workspaces. Sometime it can be difficult to remember the tag to activate to
+unhide a window. With the winview patch the window to unhide can be selected
+from the all-window view. The user switches to the all-window view (`Mod1-0`),
+selects the window (`Mod1-j`/`k` or using the mouse) and press `Mod1-o`. The key
+`Mod1-o` switches the view to the selected window tag.
 
-Usage
------
+Recommend patches
+-----------------
 
-The winview command is assigned by default to the key `Mod1-o`. To select the
-view of a window which is not currently displayed, move to the all-window view
-with `Mod1-0` key, give focus to this window (using the mouse or `Mod1-j`/`k`
-keys) and switch to the window view with `Mod1-o`. We recommend [grid](grid)
-layout for the all-window view, this layout is well adapted to display many
-windows in a limited space.
+The [grid](gridmode) layout is well adapted to display many windows in a limited
+space. Using both [grid](gridmode) and [pertag](pertag) patches you will be able to
+select this layout for the all-window view while keeping your preferred
+layout for the other views.
 
 Configuration and Installation
 ------------------------------
_AT_@ -44,7 +45,8 @@ template, config.def.h.
 Download
 --------
 
- * [dwm-6.0-winview.diff](dwm-6.0-winview.diff)
+ * [dwm-6.1-winview.diff](dwm-6.1-winview.diff)
+ * [dwm-6.0-winview.diff](historical/dwm-6.0-winview.diff)
 
 Author
 ------
Received on Sun Mar 13 2016 - 21:32:34 CET

This archive was generated by hypermail 2.3.0 : Sun Mar 13 2016 - 21:36:12 CET