[hackers] [dwm] initialize prevtags in setup, now users can setup which seltags should be selectedin config.h

From: Anselm R. Garbe <garbeam_AT_gmail.com>
Date: Sat Nov 10 19:33:57 2007

changeset: 1061:9d8238793016
tag: tip
user: Anselm R. Garbe <garbeam_AT_gmail.com>
date: Sat Nov 10 19:31:01 2007 +0100
summary: initialize prevtags in setup, now users can setup which seltags should be selectedin config.h

diff -r 9df583e2c03c -r 9d8238793016 dwm.c
--- a/dwm.c Sat Nov 10 19:16:11 2007 +0100
+++ b/dwm.c Sat Nov 10 19:31:01 2007 +0100
@@ -233,7 +233,7 @@ Regs *regs = NULL;
 /* configuration, allows nested code to access above variables */
 #include "config.h"
 
-Bool prevtags[LENGTH(tags)] = {[0] = True};
+Bool prevtags[LENGTH(tags)];
 
 /* function implementations */
 void
@@ -1467,6 +1467,7 @@ setup(void) {
         grabkeys();
 
         /* init tags */
+ memcpy(prevtags, seltags, sizeof seltags);
         compileregs();
 
         /* init appearance */
@@ -1849,11 +1850,11 @@ view(const char *arg) {
 
 void
 viewprevtag(const char *arg) {
- static Bool tmptags[sizeof tags / sizeof tags[0]];
-
- memcpy(tmptags, seltags, sizeof seltags);
+ static Bool tmp[LENGTH(tags)];
+
+ memcpy(tmp, seltags, sizeof seltags);
         memcpy(seltags, prevtags, sizeof seltags);
- memcpy(prevtags, tmptags, sizeof seltags);
+ memcpy(prevtags, tmp, sizeof seltags);
         arrange();
 }
 
Received on Sat Nov 10 2007 - 19:33:57 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:58:45 UTC