Created
October 30, 2011 03:48
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void togglefullscreen(const Arg *arg); | |
void | |
togglefullscreen(const Arg *arg) { | |
Client *c = selmon->sel; | |
if(!c) | |
return; | |
if(!c->isfullscreen) { | |
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); | |
} | |
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); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment