aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2021-09-21 14:42:36 -0500
committerDevin J. Pohly <djpohly@gmail.com>2021-09-21 14:42:36 -0500
commit7de6920bd781d77b2d8d5abb847258c6153638c7 (patch)
tree9dbd435c7054098e130527143539440e06469e4a /dwl.c
parentc8bf457c0f12955f89abf88e929a97d96d6f46de (diff)
send frame_done to all visible surfaces
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c11
1 files changed, 10 insertions, 1 deletions
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);
@@ -1589,6 +1590,13 @@ quitsignal(int signo)
}
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)
{
/* This function is called every time an output is ready to display a frame,
@@ -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