summaryrefslogtreecommitdiffhomepage
path: root/patch/fakefullscreenclient.c
blob: 2b4b279265c6849459c64fd350854dd171ece5db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
void
togglefakefullscreen(const Arg *arg)
{
    if (!selmon->sel)
        return;

    if (selmon->sel->fakefullscreen) {
        if (selmon->sel->isfullscreen)
            selmon->sel->fakefullscreen = 0;
        else
            selmon->sel->isfullscreen = 0;
    } else {
        if (selmon->sel->isfullscreen) {
            selmon->sel->isfloating = selmon->sel->oldstate;
            selmon->sel->bw = selmon->sel->oldbw;
            selmon->sel->x = selmon->sel->oldx;
            selmon->sel->y = selmon->sel->oldy;
            selmon->sel->w = selmon->sel->oldw;
            selmon->sel->h = selmon->sel->oldh;
            resizeclient(selmon->sel, selmon->sel->x, selmon->sel->y, selmon->sel->w, selmon->sel->h);
        }
        selmon->sel->fakefullscreen = 1;
        selmon->sel->isfullscreen = 0;
    }
    setfullscreen(selmon->sel, !selmon->sel->isfullscreen);
}