summaryrefslogtreecommitdiff
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to 'dwm.c')
-rw-r--r--dwm.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/dwm.c b/dwm.c
index da04bac..51a20d0 100644
--- a/dwm.c
+++ b/dwm.c
@@ -240,6 +240,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 broken[] = "broken";
static char stext[256];
@@ -2255,3 +2257,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);
+}