Commit: 5ecc3e71e74b60ca32d8078912ade8c36e0d1824
Parent: d8318f790cc5b21c2bb8830d1e04e3dc4d02fac7
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
@@ -1502,10 +1502,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;
@@ -1735,6 +1731,8 @@ void
togglefakefull(const Arg *arg)
{
fakefullscreen = !fakefullscreen;
+ if (selmon->sel && selmon->sel->isfullscreen)
+ setfullscreen(selmon->sel, 0);
}
void
@@ -1754,7 +1752,7 @@ togglefloating(const Arg *arg)
void
togglefullscr(const Arg *arg)
{
- if (selmon->sel)
+ if (!fakefullscreen && selmon->sel)
setfullscreen(selmon->sel, !selmon->sel->isfullscreen);
}