Commit: 781416ef15eec66617f9bc5d7b08626635380134
Parent: 881740dcc1b304ec81b4360063df945c6b733301
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
@@ -1509,10 +1509,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;
@@ -1748,6 +1744,8 @@ void
togglefakefull(const Arg *arg)
{
fakefullscreen = !fakefullscreen;
+ if (selmon->sel && selmon->sel->isfullscreen)
+ setfullscreen(selmon->sel, 0);
}
void
@@ -1767,7 +1765,7 @@ togglefloating(const Arg *arg)
void
togglefullscr(const Arg *arg)
{
- if (selmon->sel)
+ if (!fakefullscreen && selmon->sel)
setfullscreen(selmon->sel, !selmon->sel->isfullscreen);
}