summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorGravatar piotrruss <mail@pruss.it> 2024-04-07 21:13:28 +0200
committerGravatar piotrruss <mail@pruss.it> 2024-04-07 21:13:28 +0200
commit459a7c2290d964f371841864df66a676e51af9c3 (patch)
tree7a12559e1c2280ed608efe3ec16f3bcc172fa6fd /dwm.c
parent33e91e39690fee930c61166edd5423d3853d362a (diff)
downloaddwm-459a7c2290d964f371841864df66a676e51af9c3.tar.gz
dwm-459a7c2290d964f371841864df66a676e51af9c3.tar.bz2
dwm-459a7c2290d964f371841864df66a676e51af9c3.zip
fullscreen patch applied
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c22
1 files changed, 22 insertions, 0 deletions
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)
{
@@ -1780,6 +1795,13 @@ toggleopacity(const Arg *arg) {
}
void
+togglefullscr(const Arg *arg)
+{
+ if(selmon->sel)
+ setfullscreen(selmon->sel, !selmon->sel->isfullscreen);
+}
+
+void
toggletag(const Arg *arg)
{
unsigned int newtags;