Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -up dwm-5.7.2.orig/config.def.h dwm-5.7.2/config.def.h
- --- dwm-5.7.2.orig/config.def.h 2010-02-12 17:29:34.000000000 +0100
- +++ dwm-5.7.2/config.def.h 2010-02-12 18:29:36.000000000 +0100
- @@ -16,6 +16,9 @@ static const Bool topbar = Tr
- /* tagging */
- static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
- +/* initial layouts */
- +static const int initlayouts[] = { 0, 0, 1, 0, 1, 0, 1, 2, 0, 0 };
- +
- static const Rule rules[] = {
- /* class instance title tags mask isfloating monitor */
- { "Gimp", NULL, NULL, 0, True, -1 },
- Nur in dwm-5.7.2: config.h.
- diff -up dwm-5.7.2.orig/dwm.c dwm-5.7.2/dwm.c
- --- dwm-5.7.2.orig/dwm.c 2010-02-12 17:29:34.000000000 +0100
- +++ dwm-5.7.2/dwm.c 2010-02-12 18:28:53.000000000 +0100
- @@ -120,26 +120,6 @@ typedef struct {
- void (*arrange)(Monitor *);
- } Layout;
- -struct Monitor {
- - char ltsymbol[16];
- - 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;
- @@ -273,6 +253,31 @@ static Window root;
- /* configuration, allows nested code to access above variables */
- #include "config.h"
- +struct Monitor {
- + char ltsymbol[16];
- + 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]; };
- @@ -615,7 +620,7 @@ createmon(void) {
- m->topbar = topbar;
- m->lt[0] = &layouts[0];
- m->lt[1] = &layouts[1 % LENGTH(layouts)];
- - strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
- + strncpy(m->ltsymbol, initlayouts[1] && initlayouts[1] < LENGTH(layouts) ? layouts[initlayouts[1]].symbol : layouts[0].symbol, sizeof m->ltsymbol);
- return m;
- }
- @@ -1450,7 +1455,7 @@ setlayout(const Arg *arg) {
- if(!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
- selmon->sellt ^= 1;
- if(arg && arg->v)
- - selmon->lt[selmon->sellt] = (Layout *)arg->v;
- + selmon->lt[selmon->sellt] = selmon->lts[selmon->curtag] = (Layout *)arg->v;
- strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
- if(selmon->sel)
- arrange(selmon);
- @@ -1468,13 +1473,15 @@ setmfact(const Arg *arg) {
- f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
- if(f < 0.1 || f > 0.9)
- return;
- - selmon->mfact = f;
- + selmon->mfact = selmon->mfacts[selmon->curtag] = f;
- arrange(selmon);
- }
- void
- setup(void) {
- XSetWindowAttributes wa;
- + Monitor *m;
- + unsigned int i;
- /* clean up any zombies immediately */
- sigchld(0);
- @@ -1509,7 +1516,27 @@ setup(void) {
- 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] = initlayouts[i] && initlayouts[i] < LENGTH(layouts) ? &layouts[initlayouts[i]] : &layouts[0];
- + }
- + }
- /* init bars */
- + 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 */
- @@ -1620,7 +1647,7 @@ tile(Monitor *m) {
- void
- togglebar(const Arg *arg) {
- - selmon->showbar = !selmon->showbar;
- + selmon->showbar = selmon->showbars[selmon->curtag] = !selmon->showbar;
- updatebarpos(selmon);
- XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
- arrange(selmon);
- @@ -1640,12 +1667,27 @@ togglefloating(const Arg *arg) {
- void
- toggletag(const Arg *arg) {
- unsigned int newtags;
- + unsigned int i;
- if(!selmon->sel)
- return;
- newtags = selmon->sel->tags ^ (arg->ui & TAGMASK);
- if(newtags) {
- selmon->sel->tags = 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(selmon);
- }
- }
- @@ -1912,11 +1954,29 @@ updatewmhints(Client *c) {
- 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(selmon);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement