فهرست منبع

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

Anselm R. Garbe 18 سال پیش
والد
کامیت
667da18b31
1فایلهای تغییر یافته به همراه5 افزوده شده و 4 حذف شده
  1. 5 4
      dwm.c

+ 5 - 4
dwm.c

@@ -233,7 +233,7 @@ Regs *regs = NULL;
 /* configuration, allows nested code to access above variables */
 /* configuration, allows nested code to access above variables */
 #include "config.h"
 #include "config.h"
 
 
-Bool prevtags[LENGTH(tags)] = {[0] = True};
+Bool prevtags[LENGTH(tags)];
 
 
 /* function implementations */
 /* function implementations */
 void
 void
@@ -1467,6 +1467,7 @@ setup(void) {
 	grabkeys();
 	grabkeys();
 
 
 	/* init tags */
 	/* init tags */
+	memcpy(prevtags, seltags, sizeof seltags);
 	compileregs();
 	compileregs();
 
 
 	/* init appearance */
 	/* init appearance */
@@ -1849,11 +1850,11 @@ view(const char *arg) {
 
 
 void
 void
 viewprevtag(const char *arg) {
 viewprevtag(const char *arg) {
-	static Bool tmptags[sizeof tags / sizeof tags[0]];
+	static Bool tmp[LENGTH(tags)];
 
 
-	memcpy(tmptags, seltags, sizeof seltags);
+	memcpy(tmp, seltags, sizeof seltags);
 	memcpy(seltags, prevtags, sizeof seltags);
 	memcpy(seltags, prevtags, sizeof seltags);
-	memcpy(prevtags, tmptags, sizeof seltags);
+	memcpy(prevtags, tmp, sizeof seltags);
 	arrange();
 	arrange();
 }
 }