changeset: 260:b2a11444a75c
tag: tip
user: Jerome Andrieux <jerome_AT_gcu.info>
date: Fri Sep 18 18:44:08 2009 +0200
files: dwm.suckless.org/patches/dwm-pertag-5.6.1.diff dwm.suckless.org/patches/historical/pertag.md dwm.suckless.org/patches/pertag.md
description:
dwm pertag patch updated to 5.6.1
diff -r 83832b7e22da -r b2a11444a75c dwm.suckless.org/patches/dwm-pertag-5.6.1.diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/dwm-pertag-5.6.1.diff Fri Sep 18 18:44:08 2009 +0200
_AT_@ -0,0 +1,184 @@
+--- dwm.c 2009-09-18 18:12:50.000000000 +0200
++++ dwm.c.working 2009-09-18 18:14:04.000000000 +0200
+_AT_@ -131,6 +131,25 @@
+ void (*arrange) (Monitor *);
+ } Layout;
+
++struct Monitor {
++ float mfact;
++ int num;
++ int by; /* bar geometry */
++ int mx, my, mw, mh; /* screen size */
++ int wx, wy, ww, wh; /* window area */
++ unsigned int seltags;
++ unsigned int sellt;
++ unsigned int tagset[2];
++ Bool showbar;
++ Bool topbar;
++ Client *clients;
++ Client *sel;
++ Client *stack;
++ Monitor *next;
++ Window barwin;
++ const Layout *lt[2];
++};
++
+ typedef struct {
+ const char *class;
+ const char *instance;
+_AT_@ -263,30 +282,6 @@
+ /* configuration, allows nested code to access above variables */
+ #include "config.h"
+
+-struct Monitor {
+- float mfact;
+- int num;
+- int by; /* bar geometry */
+- int mx, my, mw, mh; /* screen size */
+- int wx, wy, ww, wh; /* window area */
+- unsigned int seltags;
+- unsigned int sellt;
+- unsigned int tagset[2];
+- Bool showbar;
+- Bool topbar;
+- Client *clients;
+- Client *sel;
+- Client *stack;
+- Monitor *next;
+- Window barwin;
+- const Layout *lt[2];
+- int curtag;
+- int prevtag;
+- const Layout *lts[LENGTH(tags) + 1];
+- double mfacts[LENGTH(tags) + 1];
+- Bool showbars[LENGTH(tags) + 1];
+-};
+-
+ /* compile-time check if all tags fit into an unsigned int bit array. */
+ struct NumTags {
+ char limitexceeded[LENGTH(tags) > 31 ? -1 : 1];
+_AT_@ -1484,7 +1479,7 @@
+ if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
+ selmon->sellt ^= 1;
+ if (arg && arg->v)
+- selmon->lt[selmon->sellt] = selmon->lts[selmon->curtag] = (Layout *) arg->v;
++ selmon->lt[selmon->sellt] = (Layout *) arg->v;
+ if (selmon->sel)
+ arrange();
+ else
+_AT_@ -1502,7 +1497,7 @@
+ f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
+ if (f < 0.1 || f > 0.9)
+ return;
+- selmon->mfact = selmon->mfacts[selmon->curtag] = f;
++ selmon->mfact = f;
+ arrange();
+ }
+
+_AT_@ -1512,7 +1507,6 @@
+ unsigned int i;
+ int w;
+ XSetWindowAttributes wa;
+- Monitor *m;
+
+ /* clean up any zombies immediately */
+ sigchld(0);
+_AT_@ -1547,31 +1541,11 @@
+ XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
+ if (!dc.font.set)
+ XSetFont(dpy, dc.gc, dc.font.xfont->fid);
+- /* init tags */
+- for (m = mons; m; m = m->next)
+- m->curtag = m->prevtag = 1;
+- /* init mfacts */
+- for (m = mons; m; m = m->next) {
+- for (i = 0; i < LENGTH(tags) + 1; i++) {
+- m->mfacts[i] = m->mfact;
+- }
+- }
+- /* init layouts */
+- for (m = mons; m; m = m->next) {
+- for (i = 0; i < LENGTH(tags) + 1; i++) {
+- m->lts[i] = &layouts[0];
+- }
+- }
+ /* init bars */
+ for (blw = i = 0; LENGTH(layouts) > 1 && i < LENGTH(layouts); i++) {
+ w = TEXTW(layouts[i].symbol);
+ blw = MAX(blw, w);
+ }
+- for (m = mons; m; m = m->next) {
+- for (i = 0; i < LENGTH(tags) + 1; i++) {
+- m->showbars[i] = m->showbar;
+- }
+- }
+ updatebars();
+ updatestatus();
+ /* EWMH support per view */
+_AT_@ -1689,7 +1663,7 @@
+ void
+ togglebar(const Arg * arg)
+ {
+- selmon->showbar = selmon->showbars[selmon->curtag] = !selmon->showbar;
++ selmon->showbar = !selmon->showbar;
+ updatebarpos(selmon);
+ XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
+ arrange();
+_AT_@ -1710,27 +1684,13 @@
+ void
+ toggletag(const Arg * arg)
+ {
+- unsigned int i;
+ unsigned int newtags;
+
+ if (!selmon->sel)
+ return;
+ newtags = selmon->sel->tags ^ (arg->ui & TAGMASK);
+ if (newtags) {
+- if (newtags == ~0) {
+- selmon->prevtag = selmon->curtag;
+- selmon->curtag = 0;
+- }
+- if (!(newtags & 1 << (selmon->curtag - 1))) {
+- selmon->prevtag = selmon->curtag;
+- for (i = 0; !(newtags & 1 << i); i++);
+- selmon->curtag = i + 1;
+- }
+ selmon->sel->tags = newtags;
+- selmon->lt[selmon->sellt] = selmon->lts[selmon->curtag];
+- selmon->mfact = selmon->mfacts[selmon->curtag];
+- if (selmon->showbar != selmon->showbars[selmon->curtag])
+- togglebar(NULL);
+ arrange();
+ }
+ }
+_AT_@ -1993,28 +1953,11 @@
+ void
+ view(const Arg * arg)
+ {
+- unsigned int i;
+ if ((arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
+ return;
+ selmon->seltags ^= 1; /* toggle sel tagset */
+- if (arg->ui & TAGMASK) {
++ if (arg->ui & TAGMASK)
+ selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
+- selmon->prevtag = selmon->curtag;
+- if (arg->ui == ~0)
+- selmon->curtag = 0;
+- else {
+- for (i = 0; !(arg->ui & 1 << i); i++);
+- selmon->curtag = i + 1;
+- }
+- } else {
+- selmon->prevtag = selmon->curtag ^ selmon->prevtag;
+- selmon->curtag ^= selmon->prevtag;
+- selmon->prevtag = selmon->curtag ^ selmon->prevtag;
+- }
+- selmon->lt[selmon->sellt] = selmon->lts[selmon->curtag];
+- selmon->mfact = selmon->mfacts[selmon->curtag];
+- if (selmon->showbar != selmon->showbars[selmon->curtag])
+- togglebar(NULL);
+ arrange();
+ }
+
diff -r 83832b7e22da -r b2a11444a75c dwm.suckless.org/patches/historical/pertag.md
--- a/dwm.suckless.org/patches/historical/pertag.md Fri Sep 18 15:21:38 2009 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
_AT_@ -1,27 +0,0 @@
-# PERTAG #
-
-## Description ##
-
-More general approach of [taglayouts patch][3]. The patch keeps layout, mwfact, barpos and nmaster (if
-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]
- * [dwm-4.6-pertag.diff][1]
- * [dwm-4.6-pertag_nmaster.diff][2]
-
-## Author ##
-
- * Jan Christoph Ebersbach - <jceb_AT_e-jc.de>
- * Updated by V4hn - v4hn.de
-
-[1]:
http://www.e-jc.de/dwm/4.6/current/dwm-4.6-pertag.diff
-[2]:
http://www.e-jc.de/dwm/4.6/current/dwm-4.6-pertag_nmaster.diff
-[3]: /dwm/patches/taglayouts.html
-[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://dwm.suckless.org/patches/dwm-5.2-pertag.diff
-[7]:
http://dwm.suckless.org/patches/dwm-5.4-pertag.diff
diff -r 83832b7e22da -r b2a11444a75c dwm.suckless.org/patches/pertag.md
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/dwm.suckless.org/patches/pertag.md Fri Sep 18 18:44:08 2009 +0200
_AT_@ -0,0 +1,30 @@
+# PERTAG #
+
+## Description ##
+
+More general approach of [taglayouts patch][3]. The patch keeps layout, mwfact, barpos and nmaster (if
+installed) per tag.
+
+## Download ##
+ * [dwm-pertag-5.6.1.diff][8]
+ * [dwm-5.4-pertag.diff][7]
+ * [dwm-5.2-pertag.diff][6]
+ * [dwm-5.1-pertag.diff][5]
+ * [dwm-5.0-pertag.diff][4]
+ * [dwm-4.6-pertag.diff][1]
+ * [dwm-4.6-pertag_nmaster.diff][2]
+
+## Author ##
+
+ * Jan Christoph Ebersbach - <jceb_AT_e-jc.de>
+ * Updated by V4hn - v4hn.de
+ * Updated by Jerome Andrieux - <jerome_AT_gcu.info>
+
+[1]:
http://www.e-jc.de/dwm/4.6/current/dwm-4.6-pertag.diff
+[2]:
http://www.e-jc.de/dwm/4.6/current/dwm-4.6-pertag_nmaster.diff
+[3]: /dwm/patches/taglayouts.html
+[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://dwm.suckless.org/patches/historical/dwm-5.2-pertag.diff
+[7]:
http://dwm.suckless.org/patches/historical/dwm-5.4-pertag.diff
+[8]:
http://dwm.suckless.org/patches/historical/dwm-pertag-5.6.1.diff
Received on Fri Sep 18 2009 - 18:44:14 CEST