bakkeby / patches

Collection of patches for dwm, st and dmenu
286 stars 30 forks source link

Change how fullscreen-compilation deals with new windows during fullscreen #86

Open JeffofBread opened 4 months ago

JeffofBread commented 4 months ago

This addition adds the function fullscreencheck() which changes how the fullscreen client reacts to a new window. Instead of just using losefullscreen(), if the window is fullscreen, it will turn it into a fakefullscreen. If It's already in fakefullscreen, it wont change. This is not meant necessarily to be a final product, but rather just a template or rough code if you wanted to implement something like this.

Code:

Definition:

static void fullscreencheck(Client *c);

Function:

void fullscreencheck(Client *c)
{
    if (!c) return;
    if (c->fakefullscreen == 0 && c->isfullscreen)
        togglefakefullscreen(0);
    else if (c->fakefullscreen == 2)
        togglefullscreen(0);
}

Edit to manage:

fullscreencheck(selmon->sel);

instead of

losefullscreen(c);

in

if (c->mon == selmon) {
    losefullscreen(c);
    unfocus(selmon->sel, 0);
}