On 12/09, tuan ta wrote:
> Hi everyone, I am using ArchLinux and dwm 6.0 for a long time. Today I
> notice that dwm-6.1/BUGS, with report from voltaic, I also have 2
> monitors with different resolution (at home and my office), I wrote a
> script helps me autoextend VGA output (with exactly resolution of the
> current extended-monitor). Repo in here:
> https://github.com/88d52bdba0366127fffca9dfa93895/txrandr , hope this
> helps you.
>
> Ref: http://lists.suckless.org/dev/1004/3788.html
>
> I know this thread is very old and I'm so sorry for any annoyance.
> Have a good day, guys.


I hope I'm interpreting this correctly; is this the bug where the bar
remains on the screen after resizing the resolution?

This has been fixed in these 2 commits:

http://git.suckless.org/dwm/commit/?id=873bcb97a90727be29fe28774fc6b5546660b447
http://git.suckless.org/dwm/commit/?id=51336aa4a38e82cc796edce790a989298e817a5a

I've attached a patch which applies cleanly on 6.0.
diff --git a/dwm.c b/dwm.c
index 1d78655..466d12c 100644
--- a/dwm.c
+++ b/dwm.c
@@ -397,9 +397,10 @@ arrange(Monitor *m) {
 		showhide(m->stack);
 	else for(m = mons; m; m = m->next)
 		showhide(m->stack);
-	if(m)
+	if(m) {
 		arrangemon(m);
-	else for(m = mons; m; m = m->next)
+		restack(m);
+	} else for(m = mons; m; m = m->next)
 		arrangemon(m);
 }
 
@@ -408,7 +409,6 @@ arrangemon(Monitor *m) {
 	strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol);
 	if(m->lt[m->sellt]->arrange)
 		m->lt[m->sellt]->arrange(m);
-	restack(m);
 }
 
 void
@@ -1827,6 +1827,8 @@ updatebars(void) {
 		.event_mask = ButtonPressMask|ExposureMask
 	};
 	for(m = mons; m; m = m->next) {
+		if (m->barwin)
+			continue;
 		m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen),
 		                          CopyFromParent, DefaultVisual(dpy, screen),
 		                          CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);

Reply via email to