aboutsummaryrefslogtreecommitdiff
path: root/swaybg/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'swaybg/main.c')
-rw-r--r--swaybg/main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/swaybg/main.c b/swaybg/main.c
index 5b6c378c..f8e7e7ef 100644
--- a/swaybg/main.c
+++ b/swaybg/main.c
@@ -48,7 +48,7 @@ struct swaybg_state {
bool is_valid_color(const char *color) {
int len = strlen(color);
if (len != 7 || color[0] != '#') {
- wlr_log(L_ERROR, "%s is not a valid color for swaybg. "
+ wlr_log(WLR_ERROR, "%s is not a valid color for swaybg. "
"Color should be specified as #rrggbb (no alpha).", color);
return false;
}
@@ -68,6 +68,9 @@ static void render_frame(struct swaybg_state *state) {
buffer_height = state->height * state->scale;
state->current_buffer = get_next_buffer(state->shm,
state->buffers, buffer_width, buffer_height);
+ if (!state->current_buffer) {
+ return;
+ }
cairo_t *cairo = state->current_buffer->cairo;
if (state->args->mode == BACKGROUND_MODE_SOLID_COLOR) {
cairo_set_source_u32(cairo, state->context.color);
@@ -185,10 +188,10 @@ int main(int argc, const char **argv) {
struct swaybg_args args = {0};
struct swaybg_state state = {0};
state.args = &args;
- wlr_log_init(L_DEBUG, NULL);
+ wlr_log_init(WLR_DEBUG, NULL);
if (argc != 4) {
- wlr_log(L_ERROR, "Do not run this program manually. "
+ wlr_log(WLR_ERROR, "Do not run this program manually. "
"See man 5 sway and look for output options.");
return 1;
}