summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/output.c31
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 = {