[wiki] [sites] Add updated version of "center" patch for dwm 6.1 || nightsense

From: <git_AT_suckless.org>
Date: Sat, 14 Nov 2015 10:32:56 +0100

commit e72c646fad44d429a42f948d399b9557840177ae
Author: nightsense <nightsense_AT_protonmail.ch>
Date: Sat Nov 14 04:28:52 2015 -0500

    Add updated version of "center" patch for dwm 6.1

diff --git a/dwm.suckless.org/patches/center.md b/dwm.suckless.org/patches/center.md
index 94dafac..4ff47b9 100644
--- a/dwm.suckless.org/patches/center.md
+++ b/dwm.suckless.org/patches/center.md
_AT_@ -10,7 +10,8 @@ monitor.
 Download
 --------
 
-* [dwm-cdec978-center.diff](dwm-cdec978-center.diff) (2k) (20140123)
+* [dwm-6.1-center.diff](dwm-6.1-center.diff) (2k) (20151114)
+* [dwm-cdec978-center.diff](historical/dwm-cdec978-center.diff) (2k) (20140123)
 
 Author
 ------
diff --git a/dwm.suckless.org/patches/dwm-6.1-center.diff b/dwm.suckless.org/patches/dwm-6.1-center.diff
new file mode 100644
index 0000000..b4a49e1
--- /dev/null
+++ b/dwm.suckless.org/patches/dwm-6.1-center.diff
_AT_@ -0,0 +1,58 @@
+diff --git a/config.def.h b/config.def.h
+index 7054c06..e0cdcf3 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -24,9 +24,9 @@ static const Rule rules[] = {
+ * WM_CLASS(STRING) = instance, class
+ * WM_NAME(STRING) = title
+ */
+- /* class instance title tags mask isfloating monitor */
+- { "Gimp", NULL, NULL, 0, 1, -1 },
+- { "Firefox", NULL, NULL, 1 << 8, 0, -1 },
++ /* class instance title tags mask iscentered isfloating monitor */
++ { "Gimp", NULL, NULL, 0, 0, 1, -1 },
++ { "Firefox", NULL, NULL, 1 << 8, 0, 0, -1 },
+ };
+
+ /* layout(s) */
+diff --git a/dwm.c b/dwm.c
+index 0362114..4aaaa60 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -92,7 +92,7 @@ struct Client {
+ int basew, baseh, incw, inch, maxw, maxh, minw, minh;
+ int bw, oldbw;
+ unsigned int tags;
+- int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
++ int isfixed, iscentered, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
+ Client *next;
+ Client *snext;
+ Monitor *mon;
+_AT_@ -137,6 +137,7 @@ typedef struct {
+ const char *instance;
+ const char *title;
+ unsigned int tags;
++ int iscentered;
+ int isfloating;
+ int monitor;
+ } Rule;
+_AT_@ -296,6 +297,7 @@ applyrules(Client *c)
+ && (!r->class || strstr(class, r->class))
+ && (!r->instance || strstr(instance, r->instance)))
+ {
++ c->iscentered = r->iscentered;
+ c->isfloating = r->isfloating;
+ c->tags |= r->tags;
+ for (m = mons; m && m->num != r->monitor; m = m->next);
+_AT_@ -1063,6 +1065,11 @@ manage(Window w, XWindowAttributes *wa)
+ && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
+ c->bw = borderpx;
+
++ if(c->iscentered) {
++ c->x = (c->mon->mw - WIDTH(c)) / 2;
++ c->y = (c->mon->mh - HEIGHT(c)) / 2;
++ }
++
+ wc.border_width = c->bw;
+ XConfigureWindow(dpy, w, CWBorderWidth, &wc);
+ XSetWindowBorder(dpy, w, scheme[SchemeNorm].border->pix);
diff --git a/dwm.suckless.org/patches/dwm-cdec978-center.diff b/dwm.suckless.org/patches/dwm-cdec978-center.diff
deleted file mode 100644
index e95ffc4..0000000
--- a/dwm.suckless.org/patches/dwm-cdec978-center.diff
+++ /dev/null
_AT_@ -1,58 +0,0 @@
-diff --git a/config.def.h b/config.def.h
-index 875885b..2e3a9fb 100644
---- a/config.def.h
-+++ b/config.def.h
-_AT_@ -21,9 +21,9 @@ static const Rule rules[] = {
- * WM_CLASS(STRING) = instance, class
- * WM_NAME(STRING) = title
- */
-- /* class instance title tags mask isfloating monitor */
-- { "Gimp", NULL, NULL, 0, True, -1 },
-- { "Firefox", NULL, NULL, 1 << 8, False, -1 },
-+ /* class instance title tags mask iscentered isfloating monitor */
-+ { "Gimp", NULL, NULL, 0, False, True, -1 },
-+ { "Firefox", NULL, NULL, 1 << 8, False, False, -1 },
- };
-
- /* layout(s) */
-diff --git a/dwm.c b/dwm.c
-index 1bbb4b3..a8a3356 100644
---- a/dwm.c
-+++ b/dwm.c
-_AT_@ -91,7 +91,7 @@ struct Client {
- int basew, baseh, incw, inch, maxw, maxh, minw, minh;
- int bw, oldbw;
- unsigned int tags;
-- Bool isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
-+ Bool isfixed, iscentered, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
- Client *next;
- Client *snext;
- Monitor *mon;
-_AT_@ -136,6 +136,7 @@ typedef struct {
- const char *instance;
- const char *title;
- unsigned int tags;
-+ Bool iscentered;
- Bool isfloating;
- int monitor;
- } Rule;
-_AT_@ -294,6 +295,7 @@ applyrules(Client *c) {
- && (!r->class || strstr(class, r->class))
- && (!r->instance || strstr(instance, r->instance)))
- {
-+ c->iscentered = r->iscentered;
- c->isfloating = r->isfloating;
- c->tags |= r->tags;
- for(m = mons; m && m->num != r->monitor; m = m->next);
-_AT_@ -1038,6 +1040,11 @@ manage(Window w, XWindowAttributes *wa) {
- && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
- c->bw = borderpx;
-
-+ if(c->iscentered) {
-+ c->x = (c->mon->mw - WIDTH(c)) / 2;
-+ c->y = (c->mon->mh - HEIGHT(c)) / 2;
-+ }
-+
- wc.border_width = c->bw;
- XConfigureWindow(dpy, w, CWBorderWidth, &wc);
- XSetWindowBorder(dpy, w, scheme[SchemeNorm].border->rgb);
diff --git a/dwm.suckless.org/patches/historical/dwm-cdec978-center.diff b/dwm.suckless.org/patches/historical/dwm-cdec978-center.diff
new file mode 100644
index 0000000..e95ffc4
--- /dev/null
+++ b/dwm.suckless.org/patches/historical/dwm-cdec978-center.diff
_AT_@ -0,0 +1,58 @@
+diff --git a/config.def.h b/config.def.h
+index 875885b..2e3a9fb 100644
+--- a/config.def.h
++++ b/config.def.h
+_AT_@ -21,9 +21,9 @@ static const Rule rules[] = {
+ * WM_CLASS(STRING) = instance, class
+ * WM_NAME(STRING) = title
+ */
+- /* class instance title tags mask isfloating monitor */
+- { "Gimp", NULL, NULL, 0, True, -1 },
+- { "Firefox", NULL, NULL, 1 << 8, False, -1 },
++ /* class instance title tags mask iscentered isfloating monitor */
++ { "Gimp", NULL, NULL, 0, False, True, -1 },
++ { "Firefox", NULL, NULL, 1 << 8, False, False, -1 },
+ };
+
+ /* layout(s) */
+diff --git a/dwm.c b/dwm.c
+index 1bbb4b3..a8a3356 100644
+--- a/dwm.c
++++ b/dwm.c
+_AT_@ -91,7 +91,7 @@ struct Client {
+ int basew, baseh, incw, inch, maxw, maxh, minw, minh;
+ int bw, oldbw;
+ unsigned int tags;
+- Bool isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
++ Bool isfixed, iscentered, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
+ Client *next;
+ Client *snext;
+ Monitor *mon;
+_AT_@ -136,6 +136,7 @@ typedef struct {
+ const char *instance;
+ const char *title;
+ unsigned int tags;
++ Bool iscentered;
+ Bool isfloating;
+ int monitor;
+ } Rule;
+_AT_@ -294,6 +295,7 @@ applyrules(Client *c) {
+ && (!r->class || strstr(class, r->class))
+ && (!r->instance || strstr(instance, r->instance)))
+ {
++ c->iscentered = r->iscentered;
+ c->isfloating = r->isfloating;
+ c->tags |= r->tags;
+ for(m = mons; m && m->num != r->monitor; m = m->next);
+_AT_@ -1038,6 +1040,11 @@ manage(Window w, XWindowAttributes *wa) {
+ && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? bh : c->mon->my);
+ c->bw = borderpx;
+
++ if(c->iscentered) {
++ c->x = (c->mon->mw - WIDTH(c)) / 2;
++ c->y = (c->mon->mh - HEIGHT(c)) / 2;
++ }
++
+ wc.border_width = c->bw;
+ XConfigureWindow(dpy, w, CWBorderWidth, &wc);
+ XSetWindowBorder(dpy, w, scheme[SchemeNorm].border->rgb);
Received on Sat Nov 14 2015 - 10:32:56 CET

This archive was generated by hypermail 2.3.0 : Sat Nov 14 2015 - 10:36:12 CET