diff options
author | emersion <contact@emersion.fr> | 2018-09-20 19:31:03 +0200 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-09-20 19:31:03 +0200 |
commit | 8a5ff5a4dbcefabaaeae98c1c53befcb986ba117 (patch) | |
tree | c3794cbf708d7fc1c41f20806f399dfc98ea8721 /swaybar | |
parent | 82f1393cbb7383179eab2d10ff679a975d1f5c43 (diff) | |
download | sway-8a5ff5a4dbcefabaaeae98c1c53befcb986ba117.tar.xz |
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')
-rw-r--r-- | swaybar/bar.c | 1 | ||||
-rw-r--r-- | swaybar/render.c | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/swaybar/bar.c b/swaybar/bar.c index 49a8ece1..69069f40 100644 --- a/swaybar/bar.c +++ b/swaybar/bar.c @@ -558,6 +558,7 @@ void bar_run(struct swaybar *bar) { } while (1) { event_loop_poll(); + wl_display_flush(bar->display); } } 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) { // TODO: this could infinite loop if the compositor assigns us a // different height than what we asked for wl_surface_commit(output->surface); - wl_display_roundtrip(bar->display); } else if (height > 0) { // Replay recording into shm and send it off output->current_buffer = get_next_buffer(bar->shm, @@ -536,7 +535,6 @@ void render_frame(struct swaybar *bar, struct swaybar_output *output) { wl_surface_damage(output->surface, 0, 0, output->width, output->height); wl_surface_commit(output->surface); - wl_display_roundtrip(bar->display); } cairo_surface_destroy(recorder); cairo_destroy(cairo); |