[wiki] [sites] update combo patch for dwm 6.1 || Matt Boswell

From: <git_AT_suckless.org>
Date: Fri, 22 Jan 2016 18:21:11 +0100

commit 7941511c6c69a62cd65028538b3aa4d56fc5b27f
Author: Matt Boswell <mordervomubel+gitlab_AT_lockmail.us>
Date: Fri Jan 22 12:19:12 2016 -0500

    update combo patch for dwm 6.1

diff --git a/dwm.suckless.org/patches/combo.md b/dwm.suckless.org/patches/combo.md
index 0ab19d2..0fc4f12 100644
--- a/dwm.suckless.org/patches/combo.md
+++ b/dwm.suckless.org/patches/combo.md
_AT_@ -18,11 +18,13 @@ and view so you could replace all usages if you wanted.
 Download
 --------
 
- * [dwm-5.9-combo.diff](dwm-5.9-combo.diff) (2010-10-30)
- * [dwm-6.0-combo.diff](dwm-6.0-combo.diff) (2012-10-09)
+ * [dwm-5.9-combo.diff](dwm-5.9-combo.diff) - 2010-10-30
+ * [dwm-6.0-combo.diff](dwm-6.0-combo.diff) - 2012-10-09
+ * [dwm-6.1-combo.diff](dwm-6.1-combo.diff) - 2016-01-22
 
 Author
 ------
 
  * Wolf Tivy - wolf at tivy dot com.
  * Dan McNair - cosfx at h0v3 dot net (mechanical update to 6.0)
+ * Matthew Boswell - mordervomubel+suckless at lockmail dot us (mechanical update to 6.1)
diff --git a/dwm.suckless.org/patches/dwm-6.1-combo.diff b/dwm.suckless.org/patches/dwm-6.1-combo.diff
new file mode 100644
index 0000000..32017db
--- /dev/null
+++ b/dwm.suckless.org/patches/dwm-6.1-combo.diff
_AT_@ -0,0 +1,75 @@
+diff --git a/dwm.c b/dwm.c
+index 0362114..40b7a99 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -234,6 +234,11 @@ static int xerrordummy(Display *dpy, XErrorEvent *ee);
+ static int xerrorstart(Display *dpy, XErrorEvent *ee);
+ static void zoom(const Arg *arg);
+
++static void keyrelease(XEvent *e);
++static void combotag(const Arg *arg);
++static void comboview(const Arg *arg);
++
++
+ /* variables */
+ static const char broken[] = "broken";
+ static char stext[256];
+_AT_@ -244,6 +249,7 @@ static int (*xerrorxlib)(Display *, XErrorEvent *);
+ static unsigned int numlockmask = 0;
+ static void (*handler[LASTEvent]) (XEvent *) = {
+ [ButtonPress] = buttonpress,
++ [ButtonRelease] = keyrelease,
+ [ClientMessage] = clientmessage,
+ [ConfigureRequest] = configurerequest,
+ [ConfigureNotify] = configurenotify,
+_AT_@ -251,6 +257,7 @@ static void (*handler[LASTEvent]) (XEvent *) = {
+ [EnterNotify] = enternotify,
+ [Expose] = expose,
+ [FocusIn] = focusin,
++ [KeyRelease] = keyrelease,
+ [KeyPress] = keypress,
+ [MappingNotify] = mappingnotify,
+ [MapRequest] = maprequest,
+_AT_@ -274,6 +281,42 @@ static Window root;
+ struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; };
+
+ /* function implementations */
++static int combo = 0;
++
++void
++keyrelease(XEvent *e) {
++ combo = 0;
++}
++
++void
++combotag(const Arg *arg) {
++ if(selmon->sel && arg->ui & TAGMASK) {
++ if (combo) {
++ selmon->sel->tags |= arg->ui & TAGMASK;
++ } else {
++ combo = 1;
++ selmon->sel->tags = arg->ui & TAGMASK;
++ }
++ focus(NULL);
++ arrange(selmon);
++ }
++}
++
++void
++comboview(const Arg *arg) {
++ unsigned newtags = arg->ui & TAGMASK;
++ if (combo) {
++ selmon->tagset[selmon->seltags] |= newtags;
++ } else {
++ selmon->seltags ^= 1; /*toggle tagset*/
++ combo = 1;
++ if (newtags)
++ selmon->tagset[selmon->seltags] = newtags;
++ }
++ focus(NULL);
++ arrange(selmon);
++}
++
+ void
+ applyrules(Client *c)
+ {
Received on Fri Jan 22 2016 - 18:21:11 CET

This archive was generated by hypermail 2.3.0 : Fri Jan 22 2016 - 18:24:16 CET