[hackers] [dwm][PATCH 2/2] Check bw before setting it to 0

From: shironeko <shironeko_AT_tesaguri.club>
Date: Sun, 19 Sep 2021 22:15:32 -0400

This is needed if somewhere else also want to temporarily set bw to 0,
like in the removeborder patch.
---
 dwm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dwm.c b/dwm.c
index d56e566..730456b 100644
--- a/dwm.c
+++ b/dwm.c
_AT_@ -1477,9 +1477,11 @@ setfullscreen(Client *c, int fullscreen)
 			PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1);
 		c->isfullscreen = 1;
 		c->oldstate = c->isfloating;
-		c->oldbw = c->bw;
-		c->bw = 0;
 		c->isfloating = 1;
+		if (c->bw > 0) {
+			c->oldbw = c->bw;
+			c->bw = 0;
+		}
 		resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh);
 		XRaiseWindow(dpy, c->win);
 	} else if (!fullscreen && c->isfullscreen){
-- 
2.33.0
Received on Mon Sep 20 2021 - 04:15:32 CEST

This archive was generated by hypermail 2.3.0 : Mon Sep 20 2021 - 04:24:30 CEST