From 5a2d87fa6cd33bd170b6e98534fe966ffa17576b Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Mon, 3 Aug 2020 12:44:47 -0500 Subject: add monocle layout --- dwl.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'dwl.c') diff --git a/dwl.c b/dwl.c index 804adae..fbdfbe0 100644 --- a/dwl.c +++ b/dwl.c @@ -189,6 +189,7 @@ static void keypress(struct wl_listener *listener, void *data); static void keypressmod(struct wl_listener *listener, void *data); static void killclient(const Arg *arg); static void maprequest(struct wl_listener *listener, void *data); +static void monocle(Monitor *m); static void motionabsolute(struct wl_listener *listener, void *data); static void motionnotify(uint32_t time); static void motionrelative(struct wl_listener *listener, void *data); @@ -932,6 +933,18 @@ maprequest(struct wl_listener *listener, void *data) applyrules(c); } +void +monocle(Monitor *m) +{ + Client *c; + + wl_list_for_each(c, &clients, link) { + if (!VISIBLEON(c, m) || c->isfloating) + continue; + resize(c, m->w.x, m->w.y, m->w.width, m->w.height, 0); + } +} + void motionabsolute(struct wl_listener *listener, void *data) { -- cgit v1.2.3