aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2020-08-03 12:44:47 -0500
committerDevin J. Pohly <djpohly@gmail.com>2020-08-03 12:44:47 -0500
commit5a2d87fa6cd33bd170b6e98534fe966ffa17576b (patch)
tree5b70d5fbfed853c97917dc98916a38c9928cb21f /dwl.c
parent27bbf9c14f81c5b09bfe2a0378c8e1f96ab89160 (diff)
add monocle layout
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c13
1 files changed, 13 insertions, 0 deletions
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);
@@ -933,6 +934,18 @@ maprequest(struct wl_listener *listener, void *data)
}
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)
{
/* This event is forwarded by the cursor when a pointer emits an _absolute_