diff options
author | 2018-07-23 20:27:56 -0400 | |
---|---|---|
committer | 2018-07-23 20:31:11 -0400 | |
commit | f4b882475eee7a81c206c7825616cc4656b2f60b (patch) | |
tree | 38e6ebf81b235424f105dcbcbb194e5e9eac70c0 /swaybg/main.c | |
parent | Implement pid->workspace tracking (diff) | |
parent | Merge pull request #2342 from RyanDwyer/update-cursor (diff) | |
download | sway-f4b882475eee7a81c206c7825616cc4656b2f60b.tar.gz sway-f4b882475eee7a81c206c7825616cc4656b2f60b.tar.zst sway-f4b882475eee7a81c206c7825616cc4656b2f60b.zip |
Merge branch 'master' into pid-workspaces
Diffstat (limited to 'swaybg/main.c')
-rw-r--r-- | swaybg/main.c | 9 |
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 { | |||
48 | bool is_valid_color(const char *color) { | 48 | bool is_valid_color(const char *color) { |
49 | int len = strlen(color); | 49 | int len = strlen(color); |
50 | if (len != 7 || color[0] != '#') { | 50 | if (len != 7 || color[0] != '#') { |
51 | wlr_log(L_ERROR, "%s is not a valid color for swaybg. " | 51 | wlr_log(WLR_ERROR, "%s is not a valid color for swaybg. " |
52 | "Color should be specified as #rrggbb (no alpha).", color); | 52 | "Color should be specified as #rrggbb (no alpha).", color); |
53 | return false; | 53 | return false; |
54 | } | 54 | } |
@@ -68,6 +68,9 @@ static void render_frame(struct swaybg_state *state) { | |||
68 | buffer_height = state->height * state->scale; | 68 | buffer_height = state->height * state->scale; |
69 | state->current_buffer = get_next_buffer(state->shm, | 69 | state->current_buffer = get_next_buffer(state->shm, |
70 | state->buffers, buffer_width, buffer_height); | 70 | state->buffers, buffer_width, buffer_height); |
71 | if (!state->current_buffer) { | ||
72 | return; | ||
73 | } | ||
71 | cairo_t *cairo = state->current_buffer->cairo; | 74 | cairo_t *cairo = state->current_buffer->cairo; |
72 | if (state->args->mode == BACKGROUND_MODE_SOLID_COLOR) { | 75 | if (state->args->mode == BACKGROUND_MODE_SOLID_COLOR) { |
73 | cairo_set_source_u32(cairo, state->context.color); | 76 | cairo_set_source_u32(cairo, state->context.color); |
@@ -185,10 +188,10 @@ int main(int argc, const char **argv) { | |||
185 | struct swaybg_args args = {0}; | 188 | struct swaybg_args args = {0}; |
186 | struct swaybg_state state = {0}; | 189 | struct swaybg_state state = {0}; |
187 | state.args = &args; | 190 | state.args = &args; |
188 | wlr_log_init(L_DEBUG, NULL); | 191 | wlr_log_init(WLR_DEBUG, NULL); |
189 | 192 | ||
190 | if (argc != 4) { | 193 | if (argc != 4) { |
191 | wlr_log(L_ERROR, "Do not run this program manually. " | 194 | wlr_log(WLR_ERROR, "Do not run this program manually. " |
192 | "See man 5 sway and look for output options."); | 195 | "See man 5 sway and look for output options."); |
193 | return 1; | 196 | return 1; |
194 | } | 197 | } |