diff -r ee36ffbd4252 config.def.h --- a/config.def.h Sun Nov 06 20:36:23 2011 +0100 +++ b/config.def.h Wed Nov 09 22:01:37 2011 -0600 @@ -34,6 +34,9 @@ { "[M]", monocle }, }; +#define LAYOUT_DEFAULT layouts[0] +#define LAYOUT_FULLSCREEN layouts[2] + /* key definitions */ #define MODKEY Mod1Mask #define TAGKEYS(KEY,TAG) \ diff -r ee36ffbd4252 dwm.c --- a/dwm.c Sun Nov 06 20:36:23 2011 +0100 +++ b/dwm.c Wed Nov 09 22:01:37 2011 -0600 @@ -1510,30 +1510,31 @@ void setfullscreen(Client *c, Bool fullscreen) { + c->isfullscreen = fullscreen; + c->oldstate = c->isfloating; + c->isfloating = False; + + focus(c); + if(fullscreen) { XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); - c->isfullscreen = True; - c->oldstate = c->isfloating; - c->oldbw = c->bw; - c->bw = 0; - c->isfloating = True; - resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); - XRaiseWindow(dpy, c->win); + PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); + selmon->sellt ^= 1; + selmon->lt[selmon->sellt] = &LAYOUT_FULLSCREEN; + selmon->showbar = False; + } else { + XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, + PropModeReplace, (unsigned char*)0, 0); + selmon->sellt ^= 1; + selmon->showbar = True; } - else { - XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char*)0, 0); - c->isfullscreen = False; - c->isfloating = c->oldstate; - c->bw = c->oldbw; - c->x = c->oldx; - c->y = c->oldy; - c->w = c->oldw; - c->h = c->oldh; - resizeclient(c, c->x, c->y, c->w, c->h); - arrange(c->mon); - } + + updatebarpos(selmon); + XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh); + + strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); + + arrange(selmon); } void diff -r ee36ffbd4252 config.def.h --- a/config.def.h Sun Nov 06 20:36:23 2011 +0100 +++ b/config.def.h Wed Nov 09 22:02:21 2011 -0600 @@ -34,6 +34,9 @@ { "[M]", monocle }, }; +#define LAYOUT_DEFAULT layouts[0] +#define LAYOUT_FULLSCREEN layouts[2] + /* key definitions */ #define MODKEY Mod1Mask #define TAGKEYS(KEY,TAG) \ diff -r ee36ffbd4252 dwm.c --- a/dwm.c Sun Nov 06 20:36:23 2011 +0100 +++ b/dwm.c Wed Nov 09 22:02:21 2011 -0600 @@ -1510,30 +1510,31 @@ void setfullscreen(Client *c, Bool fullscreen) { + c->isfullscreen = fullscreen; + c->oldstate = c->isfloating; + c->isfloating = False; + + focus(c); + if(fullscreen) { XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); - c->isfullscreen = True; - c->oldstate = c->isfloating; - c->oldbw = c->bw; - c->bw = 0; - c->isfloating = True; - resizeclient(c, c->mon->mx, c->mon->my, c->mon->mw, c->mon->mh); - XRaiseWindow(dpy, c->win); + PropModeReplace, (unsigned char*)&netatom[NetWMFullscreen], 1); + selmon->sellt ^= 1; + selmon->lt[selmon->sellt] = &LAYOUT_FULLSCREEN; + selmon->showbar = False; + } else { + XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, + PropModeReplace, (unsigned char*)0, 0); + selmon->sellt ^= 1; + selmon->showbar = True; } - else { - XChangeProperty(dpy, c->win, netatom[NetWMState], XA_ATOM, 32, - PropModeReplace, (unsigned char*)0, 0); - c->isfullscreen = False; - c->isfloating = c->oldstate; - c->bw = c->oldbw; - c->x = c->oldx; - c->y = c->oldy; - c->w = c->oldw; - c->h = c->oldh; - resizeclient(c, c->x, c->y, c->w, c->h); - arrange(c->mon); - } + + updatebarpos(selmon); + XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh); + + strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol); + + arrange(selmon); } void