Commit: 191a1dfb34758745ce97b5a05c62e64bc7c3159d
Parent: e77a24e34c06c2c7f0e0d9f0c5027addf15bb63d
Author: Randy Palamar
Date: Sun, 7 Mar 2021 13:13:40 -0700
stop clients from ending up in limbo from fakefullscreen
the behaviour when toggling the mode while in a fullscreen window was
not what was expected. now if you toggle the client be forced to return
to its previous non-fullscreen state.
the change in togglefullscr() simply avoids a needless branch into
setfullscr() when we are in fakefullscr mode
Diffstat:
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/dwm.c b/dwm.c
@@ -1503,10 +1503,6 @@ setfullscreen(Client *c, int fullscreen)
XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32,
PropModeReplace, (unsigned char*)0, 0);
c->isfullscreen = 0;
-
- if (fakefullscreen)
- return;
-
c->isfloating = c->oldstate;
c->bw = c->oldbw;
c->x = c->oldx;
@@ -1736,6 +1732,8 @@ void
togglefakefull(const Arg *arg)
{
fakefullscreen = !fakefullscreen;
+ if (selmon->sel && selmon->sel->isfullscreen)
+ setfullscreen(selmon->sel, 0);
}
void
@@ -1755,7 +1753,7 @@ togglefloating(const Arg *arg)
void
togglefullscr(const Arg *arg)
{
- if (selmon->sel)
+ if (!fakefullscreen && selmon->sel)
setfullscreen(selmon->sel, !selmon->sel->isfullscreen);
}