Commit: 9f5d54e111666d6fc64f6d1fa6197c58a0a0a2c4
Parent: 0adbef336bff39598fcb50dfbf7b04b005c12923
Author: Randy Palamar
Date: Sat, 13 Feb 2021 23:07:15 -0700
add a command/keybind to fullscreen any window
Diffstat:
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/config.def.h b/config.def.h
@@ -77,11 +77,12 @@ static const Key keys[] = {
{ MODKEY, XK_Tab, view, {0} },
{ MODKEY|ShiftMask, XK_c, killclient, {0} },
{ MODKEY, XK_t, setlayout, {.v = &layouts[0]} },
- { MODKEY, XK_f, setlayout, {.v = &layouts[1]} },
+ { MODKEY|ShiftMask, XK_f, setlayout, {.v = &layouts[1]} },
{ MODKEY, XK_m, setlayout, {.v = &layouts[2]} },
{ MODKEY, XK_space, setlayout, {0} },
{ MODKEY|ShiftMask, XK_space, togglefloating, {0} },
{ MODKEY|ShiftMask, XK_y, togglefakefull, {0} },
+ { MODKEY, XK_f, togglefullscr, {0} },
{ MODKEY, XK_0, view, {.ui = ~0 } },
{ MODKEY|ShiftMask, XK_0, tag, {.ui = ~0 } },
{ MODKEY, XK_comma, focusmon, {.i = -1 } },
diff --git a/dwm.c b/dwm.c
@@ -187,7 +187,6 @@ static Client *nexttiled(Client *c);
static void pop(Client *c);
static void propertynotify(XEvent *e);
static void quit(const Arg *arg);
-static void togglefakefull(const Arg *arg);
static Monitor *recttomon(int x, int y, int w, int h);
static void resize(Client *c, int x, int y, int w, int h, int interact);
static void resizeclient(Client *c, int x, int y, int w, int h);
@@ -210,7 +209,9 @@ static void tag(const Arg *arg);
static void tagmon(const Arg *arg);
static void tile(Monitor *m);
static void togglebar(const Arg *arg);
+static void togglefakefull(const Arg *arg);
static void togglefloating(const Arg *arg);
+static void togglefullscr(const Arg *arg);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
static void unfocus(Client *c, int setfocus);
@@ -1731,6 +1732,12 @@ togglebar(const Arg *arg)
}
void
+togglefakefull(const Arg *arg)
+{
+ fakefullscreen = !fakefullscreen;
+}
+
+void
togglefloating(const Arg *arg)
{
if (!selmon->sel)
@@ -1745,9 +1752,10 @@ togglefloating(const Arg *arg)
}
void
-togglefakefull(const Arg *arg)
+togglefullscr(const Arg *arg)
{
- fakefullscreen = !fakefullscreen;
+ if (selmon->sel)
+ setfullscreen(selmon->sel, !selmon->sel->isfullscreen);
}
void