[wiki] [sites] added pertag patch for 5.4 || a

From: <hg_AT_suckless.org>
Date: Wed, 11 Mar 2009 17:47:45 +0000 (GMT)

changeset: 44:1fed32e62d6c
tag: tip
user: a_AT_0au.de
date: Wed Mar 11 18:47:40 2009 +0100
files: dwm.suckless.org/patches/dwm-5.4-pertag.diff dwm.suckless.org/patches/pertag.md
description:
added pertag patch for 5.4


diff -r 360532149382 -r 1fed32e62d6c dwm.suckless.org/patches/dwm-5.4-pertag.diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/dwm-5.4-pertag.diff Wed Mar 11 18:47:40 2009 +0100
_AT_@ -0,0 +1,123 @@
+diff -r add6eb26ebaa dwm.c
+--- a/dwm.c Sat Dec 20 12:02:14 2008 +0000
++++ b/dwm.c Sun Dec 21 18:39:14 2008 +0100
+_AT_@ -240,6 +240,11 @@ static Window root, barwin;
+ static Window root, barwin;
+ /* 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_@ -1244,7 +1249,7 @@ setlayout(const Arg *arg) {
+ 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_@ -1261,7 +1266,7 @@ setmfact(const Arg *arg) {
+ 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_@ -1309,11 +1314,26 @@ setup(void) {
+ 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;
+_AT_@ -1434,7 +1454,7 @@ tile(void) {
+
+ void
+ togglebar(const Arg *arg) {
+- showbar = !showbar;
++ showbar = showbars[curtag] = !showbar;
+ updategeom();
+ updatebar();
+ arrange();
+_AT_@ -1467,9 +1487,23 @@ void
+ 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);
+ arrange();
+ }
+ }
+_AT_@ -1644,11 +1678,28 @@ updatewmhints(Client *c) {
+
+ 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);
+ arrange();
+ }
+
diff -r 360532149382 -r 1fed32e62d6c dwm.suckless.org/patches/pertag.md
--- a/dwm.suckless.org/patches/pertag.md Wed Mar 11 16:40:40 2009 +0000
+++ b/dwm.suckless.org/patches/pertag.md Wed Mar 11 18:47:40 2009 +0100
_AT_@ -6,6 +6,7 @@
 installed) per tag.
 
 ## Download ##
+ * [dwm-5.4-pertag.diff][7]
  * [dwm-5.2-pertag.diff][6]
  * [dwm-5.1-pertag.diff][5]
  * [dwm-5.0-pertag.diff][4]
_AT_@ -23,3 +24,4 @@
 [4]: http://www.e-jc.de/dwm/5.0/current/dwm-5.0-pertag.diff
 [5]: http://v4hn.de/patches/dwm-5.1-pertag.diff
 [6]: http://www.suckless.org/dwm/patches/dwm-5.2-pertag.diff
+[7]: http://www.suckless.org/dwm/patches/dwm-5.4-pertag.diff
Received on Wed Mar 11 2009 - 18:47:45 CET

This archive was generated by hypermail 2.3.0 : Thu Sep 13 2012 - 19:30:35 CEST