diff options
author | Leon Henrik Plickat <leonhenrik.plickat@stud.uni-goettingen.de> | 2020-09-26 12:53:19 +0200 |
---|---|---|
committer | Leon Henrik Plickat <leonhenrik.plickat@stud.uni-goettingen.de> | 2020-09-26 13:04:26 +0200 |
commit | 24e8ee33b509f71bbcaaffe83bd49eb144c2c1a7 (patch) | |
tree | 3906c5890d3ff9493e3bae1581c7c4fc2b6895cd /src/output.c | |
parent | 4a1859161d80530ba62d970f4afab2c10876e3bc (diff) | |
download | wlclock-24e8ee33b509f71bbcaaffe83bd49eb144c2c1a7.tar.gz wlclock-24e8ee33b509f71bbcaaffe83bd49eb144c2c1a7.tar.bz2 |
Render on callback
Diffstat (limited to 'src/output.c')
-rw-r--r-- | src/output.c | 16 |
1 files changed, 9 insertions, 7 deletions
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 = { |