From 459a7c2290d964f371841864df66a676e51af9c3 Mon Sep 17 00:00:00 2001 From: piotrruss Date: Sun, 7 Apr 2024 21:13:28 +0200 Subject: fullscreen patch applied --- dwm.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'dwm.c') diff --git a/dwm.c b/dwm.c index 9f5d481..c5632d0 100644 --- a/dwm.c +++ b/dwm.c @@ -202,6 +202,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 setgaps(const Arg *arg); static void setlayout(const Arg *arg); static void setmfact(const Arg *arg); @@ -214,6 +215,7 @@ static void tagmon(const Arg *arg); static void tile(Monitor *m); static void togglebar(const Arg *arg); static void togglefloating(const Arg *arg); +static void togglefullscr(const Arg *arg); static void toggleopacity(const Arg *arg); static void toggletag(const Arg *arg); static void toggleview(const Arg *arg); @@ -1542,6 +1544,19 @@ setgaps(const Arg *arg) 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 setlayout(const Arg *arg) { @@ -1779,6 +1794,13 @@ toggleopacity(const Arg *arg) { opacity(c, (bUseOpacity && c != selmon->sel) ? inactiveopacity : activeopacity); } +void +togglefullscr(const Arg *arg) +{ + if(selmon->sel) + setfullscreen(selmon->sel, !selmon->sel->isfullscreen); +} + void toggletag(const Arg *arg) { -- cgit v1.2.3