summaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2024-01-26 20:54:53 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2024-01-26 20:54:53 -0500
commit37b838f4558691e16afd3c2d940947186c8bc13c (patch)
tree0ab21dc66477076091ea08b0ebeb562a07caa1c0 /dwm.c
parentd81f5fdf4264919b1d70a012cee74a8e4d8056e8 (diff)
Implement fullscreen patch
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/dwm.c b/dwm.c
index 942a33f..2d6c0b2 100644
--- a/dwm.c
+++ b/dwm.c
@@ -217,6 +217,7 @@ static void sendmon(Client *c, Monitor *m);
static void setclientstate(Client *c, long state);
static void setfocus(Client *c);
static void setfullscreen(Client *c, int fullscreen);
+static void fullscreen(const Arg *arg);
static void setlayout(const Arg *arg);
static void setcfact(const Arg *arg);
static void setmfact(const Arg *arg);
@@ -1733,6 +1734,19 @@ setfullscreen(Client *c, int fullscreen)
}
}
+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[1] }));
+ } else {
+ setlayout(&((Arg) { .v = last_layout }));
+ }
+ togglebar(arg);
+}
+
void
setlayout(const Arg *arg)
{