aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/render.c
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-09-20 19:31:03 +0200
committerLibravatar emersion <contact@emersion.fr>2018-09-20 19:31:03 +0200
commit8a5ff5a4dbcefabaaeae98c1c53befcb986ba117 (patch)
treec3794cbf708d7fc1c41f20806f399dfc98ea8721 /swaybar/render.c
parentswaybar: handle hotplugging (diff)
downloadsway-8a5ff5a4dbcefabaaeae98c1c53befcb986ba117.tar.gz
sway-8a5ff5a4dbcefabaaeae98c1c53befcb986ba117.tar.zst
sway-8a5ff5a4dbcefabaaeae98c1c53befcb986ba117.zip
swaybar: don't wl_display_roundtrip on each frame
This was the source of numerous bugs, from hotplug events not being received to segfaults because wl_display_roundtrip was making the bar process unplug events while blocking in an iteration over all outputs.
Diffstat (limited to 'swaybar/render.c')
-rw-r--r--swaybar/render.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/swaybar/render.c b/swaybar/render.c
index 1f2dcc30..26db80cb 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -510,7 +510,6 @@ void render_frame(struct swaybar *bar, struct swaybar_output *output) {
510 // TODO: this could infinite loop if the compositor assigns us a 510 // TODO: this could infinite loop if the compositor assigns us a
511 // different height than what we asked for 511 // different height than what we asked for
512 wl_surface_commit(output->surface); 512 wl_surface_commit(output->surface);
513 wl_display_roundtrip(bar->display);
514 } else if (height > 0) { 513 } else if (height > 0) {
515 // Replay recording into shm and send it off 514 // Replay recording into shm and send it off
516 output->current_buffer = get_next_buffer(bar->shm, 515 output->current_buffer = get_next_buffer(bar->shm,
@@ -536,7 +535,6 @@ void render_frame(struct swaybar *bar, struct swaybar_output *output) {
536 wl_surface_damage(output->surface, 0, 0, 535 wl_surface_damage(output->surface, 0, 0,
537 output->width, output->height); 536 output->width, output->height);
538 wl_surface_commit(output->surface); 537 wl_surface_commit(output->surface);
539 wl_display_roundtrip(bar->display);
540 } 538 }
541 cairo_surface_destroy(recorder); 539 cairo_surface_destroy(recorder);
542 cairo_destroy(cairo); 540 cairo_destroy(cairo);