Set unmanaged monitor and remove damageallmons

This commit is contained in:
ARDiDo 2021-09-28 18:30:56 -04:00
parent dd3f342530
commit 6144aa39cc

20
dwl.c
View File

@ -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);
}