Implement toggle for fake fullscreen

This commit is contained in:
Pijus Kamandulis 2021-03-28 14:35:24 +03:00
parent db085c674b
commit 926d23911c
3 changed files with 13 additions and 0 deletions

View File

@ -104,6 +104,7 @@ static Key keys[] = {
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_q, quit, {0} },
{ MODKEY, XK_F11, togglefakefullscreen, {0} },
};
/* button definitions */

View File

@ -107,6 +107,7 @@ static Key keys[] = {
TAGKEYS( XK_8, 7)
TAGKEYS( XK_9, 8)
{ MODKEY|ShiftMask, XK_q, quit, {0} },
{ MODKEY, XK_F11, togglefakefullscreen, {0} },
};
/* button definitions */

11
dwm.c
View File

@ -242,6 +242,7 @@ static void tag(const Arg *arg);
static void tagmon(const Arg *arg);
static void tile(Monitor *);
static void togglebar(const Arg *arg);
static void togglefakefullscreen(const Arg *arg);
static void togglefloating(const Arg *arg);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
@ -1947,6 +1948,16 @@ togglebar(const Arg *arg)
arrange(selmon);
}
void
togglefakefullscreen(const Arg *arg)
{
if (!selmon->sel)
return;
selmon->sel->isfakefullscreen = !selmon->sel->isfakefullscreen;
selmon->sel->isfloating = False;
arrange(selmon);
}
void
togglefloating(const Arg *arg)
{