From 7de6920bd781d77b2d8d5abb847258c6153638c7 Mon Sep 17 00:00:00 2001 From: "Devin J. Pohly" Date: Tue, 21 Sep 2021 14:42:36 -0500 Subject: send frame_done to all visible surfaces --- dwl.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/dwl.c b/dwl.c index a15bbd8..9e811ca 100644 --- a/dwl.c +++ b/dwl.c @@ -261,6 +261,7 @@ static void pointerfocus(Client *c, struct wlr_surface *surface, static void printstatus(void); static void quit(const Arg *arg); static void quitsignal(int signo); +static void rendered(struct wlr_surface *surface, int sx, int sy, void *data); static void rendermon(struct wl_listener *listener, void *data); static void resize(Client *c, int x, int y, int w, int h, int interact); static void run(char *startup_cmd); @@ -1588,6 +1589,13 @@ quitsignal(int signo) quit(NULL); } +void +rendered(struct wlr_surface *surface, int sx, int sy, void *data) +{ + struct timespec *now = data; + wlr_surface_send_frame_done(surface, now); +} + void rendermon(struct wl_listener *listener, void *data) { @@ -1607,7 +1615,8 @@ rendermon(struct wl_listener *listener, void *data) /* Let clients know a frame has been rendered */ clock_gettime(CLOCK_MONOTONIC, &now); wl_list_for_each(c, &clients, link) - wlr_surface_send_frame_done(client_surface(c), &now); + if (VISIBLEON(c, c->mon)) + client_for_each_surface(c, rendered, &now); } void -- cgit v1.2.3