Commit: 1dc3719f0f9f0a1a3f26bd62f2b03e624d1ca305
Parent: e45565cbe9ab632033e6405deeabb6a125dfbd5c
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);
}