1 From 54719285bd1a984e2efce6e8a8eab184fec11abf Mon Sep 17 00:00:00 2001
2 From: Sermak <sermak@jarvis.com>
3 Date: Mon, 8 Jul 2019 01:06:44 +0200
4 Subject: [PATCH] Simulate toggleable fullscreen mode
8 dwm.c | 14 ++++++++++++++
9 2 files changed, 15 insertions(+)
11 diff --git a/config.def.h b/config.def.h
12 index 1c0b587..f774cc5 100644
15 @@ -76,6 +76,7 @@ static Key keys[] = {
16 { MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
17 { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
18 { MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
19 + { MODKEY|ShiftMask, XK_f, fullscreen, {0} },
20 { MODKEY, XK_space, setlayout, {0} },
21 { MODKEY|ShiftMask, XK_space, togglefloating, {0} },
22 { MODKEY, XK_0, view, {.ui = ~0 } },
23 diff --git a/dwm.c b/dwm.c
24 index 4465af1..04b1e06 100644
27 @@ -199,6 +199,7 @@ static void sendmon(Client *c, Monitor *m);
28 static void setclientstate(Client *c, long state);
29 static void setfocus(Client *c);
30 static void setfullscreen(Client *c, int fullscreen);
31 +static void fullscreen(const Arg *arg);
32 static void setlayout(const Arg *arg);
33 static void setmfact(const Arg *arg);
34 static void setup(void);
35 @@ -1497,6 +1498,19 @@ setfullscreen(Client *c, int fullscreen)
41 +fullscreen(const Arg *arg)
43 + if (selmon->showbar) {
44 + for(last_layout = (Layout *)layouts; last_layout != selmon->lt[selmon->sellt]; last_layout++);
45 + setlayout(&((Arg) { .v = &layouts[2] }));
47 + setlayout(&((Arg) { .v = last_layout }));
53 setlayout(const Arg *arg)