[PATCH] Simulate toggleable fullscreen mode
This commit is contained in:
parent
590f4d7602
commit
75a4d98edc
@ -84,6 +84,7 @@ static Key keys[] = {
|
|||||||
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
{ MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
|
||||||
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
|
||||||
{ MODKEY, XK_c, setlayout, {.v = &layouts[3]} },
|
{ MODKEY, XK_c, setlayout, {.v = &layouts[3]} },
|
||||||
|
{ MODKEY|ShiftMask, XK_f, fullscreen, {0} },
|
||||||
{ MODKEY, XK_space, setlayout, {0} },
|
{ MODKEY, XK_space, setlayout, {0} },
|
||||||
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
||||||
{ MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
|
{ MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
|
||||||
|
1
config.h
1
config.h
@ -112,6 +112,7 @@ static Key keys[] = {
|
|||||||
{ MODKEY, XK_space, setlayout, {0} },
|
{ MODKEY, XK_space, setlayout, {0} },
|
||||||
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
|
||||||
{ MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
|
{ MODKEY|ShiftMask, XK_f, togglefullscr, {0} },
|
||||||
|
{ MODKEY|ShiftMask, XK_g, fullscreen, {0} },
|
||||||
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
{ MODKEY, XK_0, view, {.ui = ~0 } },
|
||||||
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
|
||||||
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
|
||||||
|
14
dwm.c
14
dwm.c
@ -242,6 +242,7 @@ static void sendmon(Client *c, Monitor *m);
|
|||||||
static void setclientstate(Client *c, long state);
|
static void setclientstate(Client *c, long state);
|
||||||
static void setfocus(Client *c);
|
static void setfocus(Client *c);
|
||||||
static void setfullscreen(Client *c, int fullscreen);
|
static void setfullscreen(Client *c, int fullscreen);
|
||||||
|
static void fullscreen(const Arg *arg);
|
||||||
static void setgaps(const Arg *arg);
|
static void setgaps(const Arg *arg);
|
||||||
static void setlayout(const Arg *arg);
|
static void setlayout(const Arg *arg);
|
||||||
static void setmfact(const Arg *arg);
|
static void setmfact(const Arg *arg);
|
||||||
@ -1785,6 +1786,19 @@ setgaps(const Arg *arg)
|
|||||||
arrange(selmon);
|
arrange(selmon);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Layout *last_layout;
|
||||||
|
void
|
||||||
|
fullscreen(const Arg *arg)
|
||||||
|
{
|
||||||
|
if (selmon->showbar) {
|
||||||
|
for(last_layout = (Layout *)layouts; last_layout != selmon->lt[selmon->sellt]; last_layout++);
|
||||||
|
setlayout(&((Arg) { .v = &layouts[2] }));
|
||||||
|
} else {
|
||||||
|
setlayout(&((Arg) { .v = last_layout }));
|
||||||
|
}
|
||||||
|
togglebar(arg);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
setlayout(const Arg *arg)
|
setlayout(const Arg *arg)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user