Add XWayland damage tracking

This commit is contained in:
Miles Breslin 2021-03-18 19:10:05 -07:00
parent 2af3b1d588
commit 7996bfa7cc

17
dwl.c
View File

@ -378,6 +378,7 @@ static struct wl_listener request_set_sel = {.notify = setsel};
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 Atom getatom(xcb_connection_t *xc, const char *name);
static void renderindependents(struct wlr_output *output, struct timespec *now);
static void xwaylandready(struct wl_listener *listener, void *data);
@ -1411,6 +1412,12 @@ mapnotify(struct wl_listener *listener, void *data)
// Damage the whole screen
wlr_output_damage_add_whole(c->mon->damage);
#ifdef XWAYLAND
if (c->type != XDGShell)
if (c->surface.xwayland->surface)
LISTEN(&c->surface.xwayland->surface->events.commit, &c->commit, commitnotifyx11);
#endif
if (c->mon->fullscreenclient && c->mon->fullscreenclient == oldfocus
&& !c->isfloating && c->mon->lt[c->mon->sellt]->arrange) {
maximizeclient(c->mon->fullscreenclient);
@ -2560,6 +2567,16 @@ createnotifyx11(struct wl_listener *listener, void *data)
fullscreennotify);
}
void
commitnotifyx11(struct wl_listener *listener, void *data)
{
Client *c = wl_container_of(listener, c, commit);
// Damage the whole screen
if (c->mon)
wlr_output_damage_add_whole(c->mon->damage);
}
Atom
getatom(xcb_connection_t *xc, const char *name)
{