[wiki] [upstream] corrected file extensions of dwm-patches. || v4hn
changeset: 163:9309ac175af4
tag: tip
user: v4hn_AT_localhost
date: Wed Oct 15 14:55:22 2008 +0200
files: dwm/patches/dwm-5.2-monocle_count.diff dwm/patches/dwm-5.2-monocle_count.patch dwm/patches/dwm-5.2-pertag.diff dwm/patches/dwm-5.2-pertag.patch
description:
corrected file extensions of dwm-patches.
diff -r ba6673c7feb4 -r 9309ac175af4 dwm/patches/dwm-5.2-monocle_count.diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm/patches/dwm-5.2-monocle_count.diff Wed Oct 15 14:55:22 2008 +0200
_AT_@ -0,0 +1,32 @@
+--- dwm-5.2/dwm.c 2008-09-09 21:46:17.000000000 +0200
++++ dwm-5.2-monocle_count/dwm.c 2008-10-13 00:04:38.000000000 +0200
+_AT_@ -491,7 +491,8 @@
+
+ void
+ drawbar(void) {
+- int x;
++ int x, a= 0, s= 0;
++ char posbuf[10];
+ unsigned int i, occ = 0, urg = 0;
+ unsigned long *col;
+ Client *c;
+_AT_@ -517,6 +518,19 @@
+ }
+ else
+ x = dc.x;
++ if(lt[sellt]->arrange == monocle){
++ dc.x= x;
++ for(c= nexttiled(clients), a= 0, s= 0; c; c= nexttiled(c->next), a++)
++ if(c == stack)
++ s= a;
++ if(!s && a)
++ s= a;
++ snprintf(posbuf, LENGTH(posbuf), "[%d/%d]", s, a);
++ dc.w= TEXTW(posbuf);
++ drawtext(posbuf, dc.norm, False);
++ x= dc.x + dc.w;
++ }
++
+ dc.w = TEXTW(stext);
+ dc.x = ww - dc.w;
+ if(dc.x < x) {
diff -r ba6673c7feb4 -r 9309ac175af4 dwm/patches/dwm-5.2-monocle_count.patch
--- a/dwm/patches/dwm-5.2-monocle_count.patch Mon Oct 13 00:52:18 2008 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
_AT_@ -1,32 +0,0 @@
---- dwm-5.2/dwm.c 2008-09-09 21:46:17.000000000 +0200
-+++ dwm-5.2-monocle_count/dwm.c 2008-10-13 00:04:38.000000000 +0200
-_AT_@ -491,7 +491,8 @@
-
- void
- drawbar(void) {
-- int x;
-+ int x, a= 0, s= 0;
-+ char posbuf[10];
- unsigned int i, occ = 0, urg = 0;
- unsigned long *col;
- Client *c;
-_AT_@ -517,6 +518,19 @@
- }
- else
- x = dc.x;
-+ if(lt[sellt]->arrange == monocle){
-+ dc.x= x;
-+ for(c= nexttiled(clients), a= 0, s= 0; c; c= nexttiled(c->next), a++)
-+ if(c == stack)
-+ s= a;
-+ if(!s && a)
-+ s= a;
-+ snprintf(posbuf, LENGTH(posbuf), "[%d/%d]", s, a);
-+ dc.w= TEXTW(posbuf);
-+ drawtext(posbuf, dc.norm, False);
-+ x= dc.x + dc.w;
-+ }
-+
- dc.w = TEXTW(stext);
- dc.x = ww - dc.w;
- if(dc.x < x) {
diff -r ba6673c7feb4 -r 9309ac175af4 dwm/patches/dwm-5.2-pertag.diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm/patches/dwm-5.2-pertag.diff Wed Oct 15 14:55:22 2008 +0200
_AT_@ -0,0 +1,123 @@
+--- dwm-5.2/dwm.c 2008-09-09 21:46:17.000000000 +0200
++++ dwm-5.2-pertag/dwm.c 2008-10-12 23:53:30.000000000 +0200
+_AT_@ -240,6 +240,11 @@
+ /* configuration, allows nested code to access above variables */
+ #include "config.h"
+
++static int curtag = 1, prevtag = 1;
++static Layout *lts[LENGTH(tags) + 1];
++static double mfacts[LENGTH(tags) + 1];
++static Bool showbars[LENGTH(tags) + 1];
++
+ /* compile-time check if all tags fit into an unsigned int bit array. */
+ struct NumTags { char limitexceeded[sizeof(unsigned int) * 8 < LENGTH(tags) ? -1 : 1]; };
+
+_AT_@ -1272,7 +1277,7 @@
+ if(!arg || !arg->v || arg->v != lt[sellt])
+ sellt ^= 1;
+ if(arg && arg->v)
+- lt[sellt] = (Layout *)arg->v;
++ lt[sellt] = lts[curtag] = (Layout *)arg->v;
+ if(sel)
+ arrange();
+ else
+_AT_@ -1289,7 +1294,7 @@
+ f = arg->f < 1.0 ? arg->f + mfact : arg->f - 1.0;
+ if(f < 0.1 || f > 0.9)
+ return;
+- mfact = f;
++ mfact = mfacts[curtag] = f;
+ arrange();
+ }
+
+_AT_@ -1337,12 +1342,27 @@
+ if(!dc.font.set)
+ XSetFont(dpy, dc.gc, dc.font.xfont->fid);
+
++ /* init mfacts */
++ for(i=0; i < LENGTH(tags) + 1 ; i++) {
++ mfacts[i] = mfact;
++ }
++
++ /* init layouts */
++ for(i=0; i < LENGTH(tags) + 1; i++) {
++ lts[i] = &layouts[0];
++ }
++
++
+ /* init bar */
+ for(blw = i = 0; LENGTH(layouts) > 1 && i < LENGTH(layouts); i++) {
+ w = TEXTW(layouts[i].symbol);
+ blw = MAX(blw, w);
+ }
+
++ for(i=0; i < LENGTH(tags) + 1; i++) {
++ showbars[i] = showbar;
++ }
++
+ wa.override_redirect = 1;
+ wa.background_pixmap = ParentRelative;
+ wa.event_mask = ButtonPressMask|ExposureMask;
+_AT_@ -1457,7 +1477,7 @@
+
+ void
+ togglebar(const Arg *arg) {
+- showbar = !showbar;
++ showbar = showbars[curtag] = !showbar;
+ updategeom();
+ updatebar();
+ arrange();
+_AT_@ -1490,9 +1510,23 @@
+ void
+ toggleview(const Arg *arg) {
+ unsigned int mask = tagset[seltags] ^ (arg->ui & TAGMASK);
++ unsigned int i;
+
+ if(mask) {
++ if(mask == ~0) {
++ prevtag = curtag;
++ curtag = 0;
++ }
++ if(!(mask & 1 << (curtag - 1))) {
++ prevtag = curtag;
++ for (i=0; !(mask & 1 << i); i++);
++ curtag = i + 1;
++ }
+ tagset[seltags] = mask;
++ lt[sellt] = lts[curtag];
++ mfact = mfacts[curtag];
++ if (showbar != showbars[curtag])
++ togglebar(NULL);
+ clearurgent();
+ arrange();
+ }
+_AT_@ -1661,11 +1695,28 @@
+
+ void
+ view(const Arg *arg) {
++ unsigned int i;
+ if((arg->ui & TAGMASK) == tagset[seltags])
+ return;
+ seltags ^= 1; /* toggle sel tagset */
+- if(arg->ui & TAGMASK)
++ if(arg->ui & TAGMASK) {
+ tagset[seltags] = arg->ui & TAGMASK;
++ prevtag = curtag;
++ if(arg->ui == ~0)
++ curtag = 0;
++ else {
++ for (i=0; !(arg->ui & 1 << i); i++);
++ curtag = i + 1;
++ }
++ } else {
++ prevtag= curtag ^ prevtag;
++ curtag^= prevtag;
++ prevtag= curtag ^ prevtag;
++ }
++ lt[sellt]= lts[curtag];
++ mfact = mfacts[curtag];
++ if(showbar != showbars[curtag])
++ togglebar(NULL);
+ clearurgent();
+ arrange();
+ }
diff -r ba6673c7feb4 -r 9309ac175af4 dwm/patches/dwm-5.2-pertag.patch
--- a/dwm/patches/dwm-5.2-pertag.patch Mon Oct 13 00:52:18 2008 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
_AT_@ -1,123 +0,0 @@
---- dwm-5.2/dwm.c 2008-09-09 21:46:17.000000000 +0200
-+++ dwm-5.2-pertag/dwm.c 2008-10-12 23:53:30.000000000 +0200
-_AT_@ -240,6 +240,11 @@
- /* configuration, allows nested code to access above variables */
- #include "config.h"
-
-+static int curtag = 1, prevtag = 1;
-+static Layout *lts[LENGTH(tags) + 1];
-+static double mfacts[LENGTH(tags) + 1];
-+static Bool showbars[LENGTH(tags) + 1];
-+
- /* compile-time check if all tags fit into an unsigned int bit array. */
- struct NumTags { char limitexceeded[sizeof(unsigned int) * 8 < LENGTH(tags) ? -1 : 1]; };
-
-_AT_@ -1272,7 +1277,7 @@
- if(!arg || !arg->v || arg->v != lt[sellt])
- sellt ^= 1;
- if(arg && arg->v)
-- lt[sellt] = (Layout *)arg->v;
-+ lt[sellt] = lts[curtag] = (Layout *)arg->v;
- if(sel)
- arrange();
- else
-_AT_@ -1289,7 +1294,7 @@
- f = arg->f < 1.0 ? arg->f + mfact : arg->f - 1.0;
- if(f < 0.1 || f > 0.9)
- return;
-- mfact = f;
-+ mfact = mfacts[curtag] = f;
- arrange();
- }
-
-_AT_@ -1337,12 +1342,27 @@
- if(!dc.font.set)
- XSetFont(dpy, dc.gc, dc.font.xfont->fid);
-
-+ /* init mfacts */
-+ for(i=0; i < LENGTH(tags) + 1 ; i++) {
-+ mfacts[i] = mfact;
-+ }
-+
-+ /* init layouts */
-+ for(i=0; i < LENGTH(tags) + 1; i++) {
-+ lts[i] = &layouts[0];
-+ }
-+
-+
- /* init bar */
- for(blw = i = 0; LENGTH(layouts) > 1 && i < LENGTH(layouts); i++) {
- w = TEXTW(layouts[i].symbol);
- blw = MAX(blw, w);
- }
-
-+ for(i=0; i < LENGTH(tags) + 1; i++) {
-+ showbars[i] = showbar;
-+ }
-+
- wa.override_redirect = 1;
- wa.background_pixmap = ParentRelative;
- wa.event_mask = ButtonPressMask|ExposureMask;
-_AT_@ -1457,7 +1477,7 @@
-
- void
- togglebar(const Arg *arg) {
-- showbar = !showbar;
-+ showbar = showbars[curtag] = !showbar;
- updategeom();
- updatebar();
- arrange();
-_AT_@ -1490,9 +1510,23 @@
- void
- toggleview(const Arg *arg) {
- unsigned int mask = tagset[seltags] ^ (arg->ui & TAGMASK);
-+ unsigned int i;
-
- if(mask) {
-+ if(mask == ~0) {
-+ prevtag = curtag;
-+ curtag = 0;
-+ }
-+ if(!(mask & 1 << (curtag - 1))) {
-+ prevtag = curtag;
-+ for (i=0; !(mask & 1 << i); i++);
-+ curtag = i + 1;
-+ }
- tagset[seltags] = mask;
-+ lt[sellt] = lts[curtag];
-+ mfact = mfacts[curtag];
-+ if (showbar != showbars[curtag])
-+ togglebar(NULL);
- clearurgent();
- arrange();
- }
-_AT_@ -1661,11 +1695,28 @@
-
- void
- view(const Arg *arg) {
-+ unsigned int i;
- if((arg->ui & TAGMASK) == tagset[seltags])
- return;
- seltags ^= 1; /* toggle sel tagset */
-- if(arg->ui & TAGMASK)
-+ if(arg->ui & TAGMASK) {
- tagset[seltags] = arg->ui & TAGMASK;
-+ prevtag = curtag;
-+ if(arg->ui == ~0)
-+ curtag = 0;
-+ else {
-+ for (i=0; !(arg->ui & 1 << i); i++);
-+ curtag = i + 1;
-+ }
-+ } else {
-+ prevtag= curtag ^ prevtag;
-+ curtag^= prevtag;
-+ prevtag= curtag ^ prevtag;
-+ }
-+ lt[sellt]= lts[curtag];
-+ mfact = mfacts[curtag];
-+ if(showbar != showbars[curtag])
-+ togglebar(NULL);
- clearurgent();
- arrange();
- }
Received on Wed Oct 15 2008 - 14:55:35 CEST
This archive was generated by hypermail 2.3.0
: Thu Sep 13 2012 - 19:30:26 CEST