commit ecd5be9adf0dfe92f07c3c09ca1f82d3a2267625
parent 502471b84bb53c5e76fa2b8f443bffd862ab126e
Author: Natasha Kerensikova <natacha@instinctive.eu>
Date: Sat, 20 May 2023 17:13:26 +0200
[patch] dwm-focusmaster-20210804-138b405.diff
Diffstat:
M | dwm.c | | | 18 | ++++++++++++++++++ |
1 file changed, 18 insertions(+), 0 deletions(-)
diff --git a/dwm.c b/dwm.c
@@ -239,6 +239,8 @@ static int xerrordummy(Display *dpy, XErrorEvent *ee);
static int xerrorstart(Display *dpy, XErrorEvent *ee);
static void zoom(const Arg *arg);
+static void focusmaster(const Arg *arg);
+
/* variables */
static const char autostartblocksh[] = "autostart_blocking.sh";
static const char autostartsh[] = "autostart.sh";
@@ -2341,3 +2343,19 @@ main(int argc, char *argv[])
XCloseDisplay(dpy);
return EXIT_SUCCESS;
}
+
+void
+focusmaster(const Arg *arg)
+{
+ Client *c;
+
+ if (selmon->nmaster < 1)
+ return;
+ if (!selmon->sel || (selmon->sel->isfullscreen && lockfullscreen))
+ return;
+
+ c = nexttiled(selmon->clients);
+
+ if (c)
+ focus(c);
+}