aboutsummaryrefslogtreecommitdiff
path: root/swaybar
diff options
context:
space:
mode:
authorminus <minus@mnus.de>2018-07-14 00:01:43 +0200
committerminus <minus@mnus.de>2018-07-14 00:04:02 +0200
commitc73a40555f41ad765c10ea5912525c56770e71d1 (patch)
tree62c6576a23287a317c6169ac7873fdfbdca04aa7 /swaybar
parente0e31418d413a16154e7487367a889c629783d1b (diff)
swaybar/bg: Fix crash on DPMS off
When turning off displays via DPMS, swaybar and swaybg still tried to render, but did not get a valid buffer, causing them to crash.
Diffstat (limited to 'swaybar')
-rw-r--r--swaybar/render.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/swaybar/render.c b/swaybar/render.c
index 2ebd338e..909b56f4 100644
--- a/swaybar/render.c
+++ b/swaybar/render.c
@@ -503,6 +503,9 @@ void render_frame(struct swaybar *bar, struct swaybar_output *output) {
output->buffers,
output->width * output->scale,
output->height * output->scale);
+ if (!output->current_buffer) {
+ return;
+ }
cairo_t *shm = output->current_buffer->cairo;
cairo_save(shm);