diff options
author | Leon Henrik Plickat <leonhenrik.plickat@stud.uni-goettingen.de> | 2021-12-13 20:06:18 +0100 |
---|---|---|
committer | Leon Henrik Plickat <leonhenrik.plickat@stud.uni-goettingen.de> | 2021-12-13 20:06:18 +0100 |
commit | ff8142eeb28178deae0e92dee1a619356721c21e (patch) | |
tree | 6fbfc4f5bb5c748f269ee297abe37cc499ce1a23 | |
parent | 03a34f2de89648e8b30afcce27ac17f56f12bae0 (diff) | |
download | wlclock-ff8142eeb28178deae0e92dee1a619356721c21e.tar.gz wlclock-ff8142eeb28178deae0e92dee1a619356721c21e.tar.bz2 |
More cleanup
-rw-r--r-- | src/output.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/src/output.c b/src/output.c index e9c5f51..b2b4d0e 100644 --- a/src/output.c +++ b/src/output.c @@ -16,6 +16,7 @@ #include"misc.h" #include"output.h" #include"surface.h" +#include"render.h" /* No-Op function. */ static void noop () {} @@ -29,18 +30,6 @@ static void output_handle_scale (void *data, struct wl_output *wl_output, output->global_name, output->scale); } -static void output_update_surface (struct Wlclock_output *output) -{ - if ( ! output->configured || output->name == NULL ) - return; - - if ( output->surface == NULL ) - { - if ( context.output == NULL || ! strcmp(context.output, output->name) ) - create_surface(output); - } -} - static void output_handle_done (void *data, struct wl_output *wl_output) { /* This event is sent after all output property changes (by wl_output @@ -49,7 +38,23 @@ static void output_handle_done (void *data, struct wl_output *wl_output) struct Wlclock_output *output = (struct Wlclock_output *)data; clocklog(1, "[output] Atomic update complete: global_name=%d\n", output->global_name); - output_update_surface(output); + + if ( ! output->configured || output->name == NULL ) + return; + if ( output->surface == NULL ) + { + if ( context.output == NULL || ! strcmp(context.output, output->name) ) + create_surface(output); + } + else + { + if (! output->surface->configured) + return; + render_background_frame(output->surface); + render_hands_frame(output->surface); + wl_surface_commit(output->surface->hands_surface); + wl_surface_commit(output->surface->background_surface); + } } static const struct wl_output_listener output_listener = { |