[wiki] [sites] update dualstatus patch for dwm 6.1 release || Andrew Milkovich

From: <git_AT_suckless.org>
Date: Tue, 10 Nov 2015 23:46:53 +0100

commit d70de1f4062be402d24c7b3d1c7fb675e20cf0b5
Author: Andrew Milkovich <amilkovich_AT_gmail.com>
Date: Tue Nov 10 14:47:14 2015 -0800

    update dualstatus patch for dwm 6.1 release

diff --git a/dwm.suckless.org/patches/dualstatus.md b/dwm.suckless.org/patches/dualstatus.md
index d09def0..58648a6 100644
--- a/dwm.suckless.org/patches/dualstatus.md
+++ b/dwm.suckless.org/patches/dualstatus.md
_AT_@ -11,7 +11,7 @@ xsetroot -name "top text;bottom text"
 Download
 --------
 
- * [dwm-6.1-dualstatus.diff](dwm-6.1-dualstatus.diff) (4688b) (20130908)
+ * [dwm-6.1-dualstatus.diff](dwm-6.1-dualstatus.diff) (4683b) (20151110)
  * [dwm-6.0-dualstatus.diff](dwm-6.0-dualstatus.diff) (4794b) (20130908)
 
 Screenshot
diff --git a/dwm.suckless.org/patches/dwm-6.1-dualstatus.diff b/dwm.suckless.org/patches/dwm-6.1-dualstatus.diff
index 96b8f66..1546b5a 100644
--- a/dwm.suckless.org/patches/dwm-6.1-dualstatus.diff
+++ b/dwm.suckless.org/patches/dwm-6.1-dualstatus.diff
_AT_@ -1,16 +1,16 @@
 diff --git a/config.def.h b/config.def.h
-index eaae8f3..05ca3cb 100644
+index 7054c06..b96107a 100644
 --- a/config.def.h
 +++ b/config.def.h
-_AT_@ -17,6 +17,7 @@ static const unsigned int borderpx = 1; /* border pixel of windows */
+_AT_@ -15,6 +15,7 @@ static const unsigned int borderpx = 1; /* border pixel of windows */
  static const unsigned int snap = 32; /* snap pixel */
- static const Bool showbar = True; /* False means no bar */
- static const Bool topbar = True; /* False means bottom bar */
-+static const Bool extrabar = True; /* False means no extra bar */
+ static const int showbar = 1; /* 0 means no bar */
+ static const int topbar = 1; /* 0 means bottom bar */
++static const int extrabar = 1; /* 0 means no extra bar */
  
  /* tagging */
  static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
-_AT_@ -64,6 +65,7 @@ static Key keys[] = {
+_AT_@ -62,6 +63,7 @@ static Key keys[] = {
          { MODKEY, XK_p, spawn, {.v = dmenucmd } },
          { MODKEY|ShiftMask, XK_Return, spawn, {.v = termcmd } },
          { MODKEY, XK_b, togglebar, {0} },
_AT_@ -19,7 +19,7 @@ index eaae8f3..05ca3cb 100644
          { MODKEY, XK_k, focusstack, {.i = -1 } },
          { MODKEY, XK_i, incnmaster, {.i = +1 } },
 diff --git a/dwm.c b/dwm.c
-index 169adcb..0eae8b2 100644
+index 0362114..9b7cd74 100644
 --- a/dwm.c
 +++ b/dwm.c
 _AT_@ -141,6 +141,13 @@ typedef struct {
_AT_@ -28,14 +28,14 @@ index 169adcb..0eae8b2 100644
  
 +typedef struct {
 + int y;
-+ Bool show;
++ int show;
 + Window win;
 + char text[256];
 +} Bar;
 +
  /* function declarations */
  static void applyrules(Client *c);
- static Bool applysizehints(Client *c, int *x, int *y, int *w, int *h, Bool interact);
+ static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact);
 _AT_@ -210,6 +217,7 @@ static void tag(const Arg *arg);
  static void tagmon(const Arg *arg);
  static void tile(Monitor *);
_AT_@ -52,24 +52,24 @@ index 169adcb..0eae8b2 100644
  
  /* configuration, allows nested code to access above variables */
  #include "config.h"
-_AT_@ -469,6 +478,8 @@ cleanup(void) {
- while(m->stack)
- unmanage(m->stack, False);
+_AT_@ -477,6 +486,8 @@ cleanup(void)
+ while (m->stack)
+ unmanage(m->stack, 0);
          XUngrabKey(dpy, AnyKey, AnyModifier, root);
 + XUnmapWindow(dpy, eb.win);
 + XDestroyWindow(dpy, eb.win);
- while(mons)
+ while (mons)
                  cleanupmon(mons);
- drw_cur_free(drw, cursor[CurNormal]);
-_AT_@ -568,6 +579,7 @@ configurenotify(XEvent *e) {
+ for (i = 0; i < CurLast; i++)
+_AT_@ -578,6 +589,7 @@ configurenotify(XEvent *e)
                          updatebars();
- for(m = mons; m; m = m->next)
+ for (m = mons; m; m = m->next)
                                  XMoveResizeWindow(dpy, m->barwin, m->wx, m->by, m->ww, bh);
 + XMoveResizeWindow(dpy, eb.win, mons->wx, eb.y, mons->ww, bh);
                          focus(NULL);
                          arrange(NULL);
                  }
-_AT_@ -738,6 +750,9 @@ drawbar(Monitor *m) {
+_AT_@ -751,6 +763,9 @@ drawbar(Monitor *m)
                  }
          }
          drw_map(drw, m->barwin, 0, 0, m->ww, bh);
_AT_@ -79,19 +79,20 @@ index 169adcb..0eae8b2 100644
  }
  
  void
-_AT_@ -1509,6 +1524,7 @@ setup(void) {
+_AT_@ -1558,6 +1573,7 @@ setup(void)
          root = RootWindow(dpy, screen);
          drw = drw_create(dpy, screen, root, sw, sh);
          drw_load_fonts(drw, fonts, LENGTH(fonts));
 + eb.show = extrabar;
          if (!drw->fontcount)
- die("No fonts could be loaded.
");
+ die("no fonts could be loaded.
");
          bh = drw->fonts[0]->h + 2;
-_AT_@ -1643,6 +1659,16 @@ togglebar(const Arg *arg) {
+_AT_@ -1699,6 +1715,17 @@ togglebar(const Arg *arg)
  }
  
  void
-+toggleextrabar(const Arg *arg) {
++toggleextrabar(const Arg *arg)
++{
 + if(selmon == mons) {
 + eb.show = !eb.show;
 + updatebarpos(selmon);
_AT_@ -101,26 +102,26 @@ index 169adcb..0eae8b2 100644
 +}
 +
 +void
- togglefloating(const Arg *arg) {
- if(!selmon->sel)
- return;
-_AT_@ -1747,6 +1773,13 @@ updatebars(void) {
+ togglefloating(const Arg *arg)
+ {
+ if (!selmon->sel)
+_AT_@ -1810,6 +1837,13 @@ updatebars(void)
                  XDefineCursor(dpy, m->barwin, cursor[CurNormal]->cursor);
                  XMapRaised(dpy, m->barwin);
          }
 + if(!eb.win) {
 + eb.win = XCreateWindow(dpy, root, mons->wx, eb.y, mons->ww, bh, 0, DefaultDepth(dpy, screen),
-+ CopyFromParent, DefaultVisual(dpy, screen),
-+ CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
++ CopyFromParent, DefaultVisual(dpy, screen),
++ CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
 + XDefineCursor(dpy, eb.win, cursor[CurNormal]->cursor);
 + XMapRaised(dpy, eb.win);
 + }
  }
  
  void
-_AT_@ -1760,6 +1793,13 @@ updatebarpos(Monitor *m) {
- }
- else
+_AT_@ -1823,6 +1857,13 @@ updatebarpos(Monitor *m)
+ m->wy = m->topbar ? m->wy + bh : m->wy;
+ } else
                  m->by = -bh;
 + if(m == mons && eb.show) {
 + m->wh -= bh;
_AT_@ -132,11 +133,11 @@ index 169adcb..0eae8b2 100644
  }
  
  void
-_AT_@ -1932,8 +1972,21 @@ updatetitle(Client *c) {
-
+_AT_@ -1992,8 +2033,21 @@ updatetitle(Client *c)
  void
- updatestatus(void) {
-- if(!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
+ updatestatus(void)
+ {
+- if (!gettextprop(root, XA_WM_NAME, stext, sizeof(stext)))
 + char text[512];
 + if(!gettextprop(root, XA_WM_NAME, text, sizeof(text))) {
                  strcpy(stext, "dwm-"VERSION);
Received on Tue Nov 10 2015 - 23:46:53 CET

This archive was generated by hypermail 2.3.0 : Tue Nov 10 2015 - 23:48:16 CET