From 6144aa39cc1d43c09a6e127a3d21e78d49e6116b Mon Sep 17 00:00:00 2001 From: ARDiDo <90479315+ARDiDo@users.noreply.github.com> Date: Tue, 28 Sep 2021 18:30:56 -0400 Subject: [PATCH] Set unmanaged monitor and remove damageallmons --- dwl.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/dwl.c b/dwl.c index 05c647f..6a2d220 100644 --- a/dwl.c +++ b/dwl.c @@ -383,7 +383,6 @@ static void activatex11(struct wl_listener *listener, void *data); static void configurex11(struct wl_listener *listener, void *data); static void createnotifyx11(struct wl_listener *listener, void *data); void commitnotifyx11(struct wl_listener *listener, void *data); -static void damageallmons(); static Atom getatom(xcb_connection_t *xc, const char *name); static void mapnotify_unmanaged(struct wl_listener *listener, void *data); static void renderindependents(struct wlr_output *output, struct timespec *now); @@ -2622,20 +2621,7 @@ commitnotifyx11(struct wl_listener *listener, void *data) Client *c = wl_container_of(listener, c, commit); // Damage the whole screen - if (c->type == X11Managed) - wlr_output_damage_add_whole(c->mon->damage); - else - damageallmons(); -} - -void -damageallmons() -{ - Monitor *m; - - wl_list_for_each(m, &mons, link) - if (m && m->wlr_output && m->damage) - wlr_output_damage_add_whole(m->damage); + wlr_output_damage_add_whole(c->mon->damage); } Atom @@ -2656,8 +2642,10 @@ mapnotify_unmanaged(struct wl_listener *listener, void *data) { Client *c = wl_container_of(listener, c, map); wl_list_insert(&independents, &c->link); + client_get_geometry(c, &c->geom); + c->mon = xytomon(c->geom.x, c->geom.y); LISTEN(&c->surface.xwayland->surface->events.commit, &c->commit, commitnotifyx11); - damageallmons(); + wlr_output_damage_add_whole(c->mon->damage); }