summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dwl.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/dwl.c b/dwl.c
index 386763a..d630d06 100644
--- a/dwl.c
+++ b/dwl.c
@@ -173,6 +173,7 @@ struct Monitor {
struct wlr_scene_output *scene_output;
struct wl_listener frame;
struct wl_listener destroy;
+ struct wl_listener request_state;
struct wlr_box m; /* monitor area, layout-relative */
struct wlr_box w; /* window area, layout-relative */
struct wl_list layers[4]; /* LayerSurface::link */
@@ -260,6 +261,7 @@ static void quit(const Arg *arg);
static void quitsignal(int signo);
static void rendermon(struct wl_listener *listener, void *data);
static void requeststartdrag(struct wl_listener *listener, void *data);
+static void requestmonstate(struct wl_listener *listener, void *data);
static void resize(Client *c, struct wlr_box geo, int interact);
static void run(char *startup_cmd);
static Client *selclient(void);
@@ -865,6 +867,7 @@ createmon(struct wl_listener *listener, void *data)
/* Set up event listeners */
LISTEN(&wlr_output->events.frame, &m->frame, rendermon);
LISTEN(&wlr_output->events.destroy, &m->destroy, cleanupmon);
+ LISTEN(&wlr_output->events.request_state, &m->request_state, requestmonstate);
wlr_output_enable(wlr_output, 1);
if (!wlr_output_commit(wlr_output))
@@ -1709,6 +1712,13 @@ requeststartdrag(struct wl_listener *listener, void *data)
}
void
+requestmonstate(struct wl_listener *listener, void *data)
+{
+ struct wlr_output_event_request_state *event = data;
+ wlr_output_commit_state(event->output, event->state);
+}
+
+void
resize(Client *c, struct wlr_box geo, int interact)
{
struct wlr_box *bbox = interact ? &sgeom : &c->mon->w;