scratchpad: Ensure new clients spawned by scratchpad go to underlying tag

Came from following: https://prithu.dev/posts/debugging-dwm/.  An
issue I thought I had to live with is actually trivial to fix!  Full
credit to them.
This commit is contained in:
2025-11-26 03:51:45 +00:00
parent 43c355c489
commit 6426d580be

2
dwm.c
View File

@@ -1177,6 +1177,7 @@ manage(Window w, XWindowAttributes *wa)
c->oldbw = wa->border_width;
updatetitle(c);
selmon->tagset[selmon->seltags] &= ~scratchtag;
if (XGetTransientForHint(dpy, w, &trans) && (t = wintoclient(trans))) {
c->mon = t->mon;
c->tags = t->tags;
@@ -1193,7 +1194,6 @@ manage(Window w, XWindowAttributes *wa)
c->y = MAX(c->y, c->mon->wy);
c->bw = borderpx;
selmon->tagset[selmon->seltags] &= ~scratchtag;
if (!strcmp(c->name, scratchpadname)) {
c->mon->tagset[c->mon->seltags] |= c->tags = scratchtag;
c->isfloating = True;