From 24e8ee33b509f71bbcaaffe83bd49eb144c2c1a7 Mon Sep 17 00:00:00 2001 From: Leon Henrik Plickat Date: Sat, 26 Sep 2020 12:53:19 +0200 Subject: Render on callback --- src/output.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/output.c') diff --git a/src/output.c b/src/output.c index 102d510..a6980ae 100644 --- a/src/output.c +++ b/src/output.c @@ -34,9 +34,14 @@ static void output_update_surface (struct Wlclock_output *output) if ( ! output->configured || output->name == NULL ) return; - struct Wlclock *clock = output->clock; - if ( clock->output == NULL || ! strcmp(clock->output, output->name) ) - create_surface(output); + if ( output->surface == NULL ) + { + struct Wlclock *clock = output->clock; + if ( clock->output == NULL || ! strcmp(clock->output, output->name) ) + create_surface(output); + } + else + update_surface(output->surface); } static void output_handle_done (void *data, struct wl_output *wl_output) @@ -47,10 +52,7 @@ static void output_handle_done (void *data, struct wl_output *wl_output) struct Wlclock_output *output = (struct Wlclock_output *)data; clocklog(output->clock, 1, "[output] Atomic update complete: global_name=%d\n", output->global_name); - if ( output->surface != NULL ) - update_surface(output->surface); - else - output_update_surface(output); + output_update_surface(output); } static const struct wl_output_listener output_listener = { -- cgit v1.2.3