aboutsummaryrefslogtreecommitdiff
path: root/swaylock/render.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-05-25 19:34:36 +0100
committeremersion <contact@emersion.fr>2018-05-27 13:39:38 +0100
commitcc10c7af6528f6006e4fccbbdc2156b957cdd5c9 (patch)
tree5e1ebce0a9a71954679ade0676e3b7db01b018f2 /swaylock/render.c
parente4c54b04ce90d2d051ba7343ec5b9dce1bbb6755 (diff)
swaylock: implement a proper render loop
Diffstat (limited to 'swaylock/render.c')
-rw-r--r--swaylock/render.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/swaylock/render.c b/swaylock/render.c
index 05236dea..2032ddcf 100644
--- a/swaylock/render.c
+++ b/swaylock/render.c
@@ -23,6 +23,10 @@ void render_frame(struct swaylock_surface *surface) {
surface->current_buffer = get_next_buffer(state->shm,
surface->buffers, buffer_width, buffer_height);
+ if (surface->current_buffer == NULL) {
+ return;
+ }
+
cairo_t *cairo = surface->current_buffer->cairo;
cairo_identity_matrix(cairo);