aboutsummaryrefslogtreecommitdiff
path: root/swaylock/render.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-05-27 08:58:35 -0400
committerGitHub <noreply@github.com>2018-05-27 08:58:35 -0400
commit067eb83f11cb25138b112a68e2eeee263cf0128e (patch)
tree5e1ebce0a9a71954679ade0676e3b7db01b018f2 /swaylock/render.c
parente4c54b04ce90d2d051ba7343ec5b9dce1bbb6755 (diff)
parentcc10c7af6528f6006e4fccbbdc2156b957cdd5c9 (diff)
Merge pull request #2042 from emersion/swaylock-render-loop
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);