diff options
Diffstat (limited to 'swaybar/render.c')
-rw-r--r-- | swaybar/render.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/swaybar/render.c b/swaybar/render.c index 97690338..26db80cb 100644 --- a/swaybar/render.c +++ b/swaybar/render.c | |||
@@ -1,4 +1,5 @@ | |||
1 | #define _POSIX_C_SOURCE 200809L | 1 | #define _POSIX_C_SOURCE 200809L |
2 | #include <assert.h> | ||
2 | #include <limits.h> | 3 | #include <limits.h> |
3 | #include <stdlib.h> | 4 | #include <stdlib.h> |
4 | #include <stdint.h> | 5 | #include <stdint.h> |
@@ -480,6 +481,8 @@ static uint32_t render_to_cairo(cairo_t *cairo, | |||
480 | } | 481 | } |
481 | 482 | ||
482 | void render_frame(struct swaybar *bar, struct swaybar_output *output) { | 483 | void render_frame(struct swaybar *bar, struct swaybar_output *output) { |
484 | assert(output->surface != NULL); | ||
485 | |||
483 | struct swaybar_hotspot *hotspot, *tmp; | 486 | struct swaybar_hotspot *hotspot, *tmp; |
484 | wl_list_for_each_safe(hotspot, tmp, &output->hotspots, link) { | 487 | wl_list_for_each_safe(hotspot, tmp, &output->hotspots, link) { |
485 | if (hotspot->destroy) { | 488 | if (hotspot->destroy) { |
@@ -507,7 +510,6 @@ void render_frame(struct swaybar *bar, struct swaybar_output *output) { | |||
507 | // TODO: this could infinite loop if the compositor assigns us a | 510 | // TODO: this could infinite loop if the compositor assigns us a |
508 | // different height than what we asked for | 511 | // different height than what we asked for |
509 | wl_surface_commit(output->surface); | 512 | wl_surface_commit(output->surface); |
510 | wl_display_roundtrip(bar->display); | ||
511 | } else if (height > 0) { | 513 | } else if (height > 0) { |
512 | // Replay recording into shm and send it off | 514 | // Replay recording into shm and send it off |
513 | output->current_buffer = get_next_buffer(bar->shm, | 515 | output->current_buffer = get_next_buffer(bar->shm, |
@@ -533,7 +535,6 @@ void render_frame(struct swaybar *bar, struct swaybar_output *output) { | |||
533 | wl_surface_damage(output->surface, 0, 0, | 535 | wl_surface_damage(output->surface, 0, 0, |
534 | output->width, output->height); | 536 | output->width, output->height); |
535 | wl_surface_commit(output->surface); | 537 | wl_surface_commit(output->surface); |
536 | wl_display_roundtrip(bar->display); | ||
537 | } | 538 | } |
538 | cairo_surface_destroy(recorder); | 539 | cairo_surface_destroy(recorder); |
539 | cairo_destroy(cairo); | 540 | cairo_destroy(cairo); |