diff options
author | 2024-04-07 21:13:28 +0200 | |
---|---|---|
committer | 2024-04-07 21:13:28 +0200 | |
commit | 459a7c2290d964f371841864df66a676e51af9c3 (patch) | |
tree | 7a12559e1c2280ed608efe3ec16f3bcc172fa6fd | |
parent | 33e91e39690fee930c61166edd5423d3853d362a (diff) | |
download | dwm-459a7c2290d964f371841864df66a676e51af9c3.tar.gz dwm-459a7c2290d964f371841864df66a676e51af9c3.tar.bz2 dwm-459a7c2290d964f371841864df66a676e51af9c3.zip |
fullscreen patch applied
-rw-r--r-- | config.def.h | 2 | ||||
-rw-r--r-- | dwm.1 | 3 | ||||
-rw-r--r-- | dwm.c | 22 |
3 files changed, 27 insertions, 0 deletions
diff --git a/config.def.h b/config.def.h index 324c769..d6d0d88 100644 --- a/config.def.h +++ b/config.def.h @@ -87,8 +87,10 @@ static const Key keys[] = { { MODKEY, XK_t, setlayout, {.v = &layouts[0]} }, { MODKEY, XK_f, setlayout, {.v = &layouts[1]} }, { MODKEY, XK_m, setlayout, {.v = &layouts[2]} }, + { MODKEY|ShiftMask, XK_f, fullscreen, {0} }, { MODKEY, XK_space, setlayout, {0} }, { MODKEY|ShiftMask, XK_space, togglefloating, {0} }, + { MODKEY|ShiftMask, XK_f, togglefullscr, {0} }, { MODKEY, XK_0, view, {.ui = ~0 } }, { MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } }, { MODKEY, XK_comma, focusmon, {.i = -1 } }, @@ -116,6 +116,9 @@ Zooms/cycles focused window to/from master area (tiled layouts only). .B Mod1\-Shift\-c Close focused window. .TP +.B Mod1\-Shift\-f +Toggle fullscreen for focused window. +.TP .B Mod1\-Shift\-space Toggle focused window between tiled and floating state. .TP @@ -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; |