dwm-patches icon indicating copy to clipboard operation
dwm-patches copied to clipboard

Single tagset fails to display multiple tags

Open zoriya opened this issue 2 years ago • 1 comments

Hello, just wanted to inform you that with the latest version of the single-tagset patch, only one tag can be seen on a screen at a time. After a bit of investigation, it seems to be just a bad copy paste in your last update.

This is the function toggleview, extracted from the patch:

@@ -1740,12 +1823,27 @@ toggletag(const Arg *arg)
 void
 toggleview(const Arg *arg)
 {
+	Monitor *m;
 	unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
 
 	if (newtagset) {
+		/* prevent displaying the same tags on multiple monitors */
+		for(m = mons; m; m = m->next)
+			if(m != selmon && newtagset & m->tagset[m->seltags])
+				return;
 		selmon->tagset[selmon->seltags] = newtagset;
-		focus(NULL);
+		attachclients(selmon);
 		arrange(selmon);
+		focus(NULL);
+
+		unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
+
+		if (newtagset) {
+			selmon->tagset[selmon->seltags] = newtagset;
+			attachclients(selmon);
+			arrange(selmon);
+			focus(NULL);
+		}
 	}
 }

For it to work, it should be

@@ -1740,12 +1823,27 @@ toggletag(const Arg *arg)
 void
 toggleview(const Arg *arg)
 {
+	Monitor *m;
 	unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
 
 	if (newtagset) {
+		/* prevent displaying the same tags on multiple monitors */
+		for(m = mons; m; m = m->next)
+			if(m != selmon && newtagset & m->tagset[m->seltags])
+				return;
 		selmon->tagset[selmon->seltags] = newtagset;
-		focus(NULL);
+		attachclients(selmon);
 		arrange(selmon);
+		focus(NULL);
 }

zoriya avatar Feb 06 '22 00:02 zoriya

Thank you for reporting the issue. I moved to xmonad some time ago, the dwm patches aren't maintained anymore.

jceb avatar Feb 07 '22 05:02 jceb