diff -up dwm-4.3/dwm.h dwm-4.3-viewmode/dwm.h --- dwm-4.3/dwm.h 2007-07-15 11:40:26.000000000 +0100 +++ dwm-4.3-viewmode/dwm.h 2007-07-15 11:41:39.000000000 +0100 @@ -88,6 +88,7 @@ extern void (*handler[LASTEvent])(XEvent extern Atom wmatom[WMLast], netatom[NetLast]; extern Bool selscreen, *seltag; /* seltag is array of Bool */ extern unsigned int currenttag, lasttag; /* The last tag viewed */ +extern unsigned int viewmodes[10]; extern Client *clients, *sel, *stack; /* global client list and stack */ extern Cursor cursor[CurLast]; extern DC dc; /* global draw context */ @@ -131,6 +132,7 @@ void setlayout(const char *arg); /* sets void togglebar(const char *arg); /* shows/hides the bar */ void togglemax(const char *arg); /* toggles maximization of floating client */ void zoom(const char *arg); /* zooms the focused client to master area, arg is ignored */ +void checkmode(const char *arg); /* main.c */ void updatebarpos(void); /* updates the bar position */ Only in dwm-4.3-viewmode/: dwm.h.orig Only in dwm-4.3-viewmode/: dwm.h.rej diff -up dwm-4.3/layout.c dwm-4.3-viewmode/layout.c --- dwm-4.3/layout.c 2007-07-14 20:11:29.000000000 +0100 +++ dwm-4.3-viewmode/layout.c 2007-07-15 11:49:03.000000000 +0100 @@ -82,6 +82,16 @@ floating(void) { } void +checkmode(const char *arg) { + int i; + i = atoi(arg); + + if (lt != &layout[viewmodes[i]]) { + lt = &layout[viewmodes[i]]; + } +} + +void focusclient(const char *arg) { Client *c; @@ -195,14 +205,19 @@ setlayout(const char *arg) { if(!arg) { lt++; + viewmodes[currenttag]++; if(lt == layout + nlayouts) - lt = layout; + { + lt = layout; + viewmodes[currenttag] = 0; + } } else { i = atoi(arg); if(i < 0 || i >= nlayouts) return; lt = &layout[i]; + viewmodes[currenttag] = i; } if(sel) lt->arrange(); Only in dwm-4.3-viewmode/: layout.c.orig Only in dwm-4.3-viewmode/: layout.c.rej diff -up dwm-4.3/main.c dwm-4.3-viewmode/main.c --- dwm-4.3/main.c 2007-07-15 11:40:26.000000000 +0100 +++ dwm-4.3-viewmode/main.c 2007-07-15 11:41:08.000000000 +0100 @@ -20,6 +20,7 @@ unsigned int bh, ntags; unsigned int bpos = BARPOS; unsigned int numlockmask = 0; unsigned int currenttag, lasttag; +unsigned int viewmodes[10]; Atom wmatom[WMLast], netatom[NetLast]; Bool *seltag; Bool selscreen = True; @@ -186,6 +187,9 @@ setup(void) { initlayouts(); currenttag = 0; lasttag = 0; + for (i = 0; i < sizeof(viewmodes); ++i) { + viewmodes[i] = 0; + } /* bar */ dc.h = bh = dc.font.height + 2; wa.override_redirect = 1; Only in dwm-4.3-viewmode/: main.c.orig diff -up dwm-4.3/tag.c dwm-4.3-viewmode/tag.c --- dwm-4.3/tag.c 2007-07-15 11:40:26.000000000 +0100 +++ dwm-4.3-viewmode/tag.c 2007-07-15 11:41:08.000000000 +0100 @@ -151,6 +151,7 @@ void view(const char *arg) { int i; + checkmode(arg); for(i = 0; i < ntags; i++) seltag[i] = arg == NULL; i = arg ? atoi(arg) : 0; Only in dwm-4.3-viewmode/: tag.c.orig