diff options
Diffstat (limited to 'swaybg/main.c')
-rw-r--r-- | swaybg/main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/swaybg/main.c b/swaybg/main.c index b4614ac0..8d95f60a 100644 --- a/swaybg/main.c +++ b/swaybg/main.c | |||
@@ -1,3 +1,4 @@ | |||
1 | #include "wayland-desktop-shell-client-protocol.h" | ||
1 | #include <stdio.h> | 2 | #include <stdio.h> |
2 | #include <stdlib.h> | 3 | #include <stdlib.h> |
3 | #include <wayland-client.h> | 4 | #include <wayland-client.h> |
@@ -14,12 +15,16 @@ void sway_terminate(void) { | |||
14 | 15 | ||
15 | int main(int argc, char **argv) { | 16 | int main(int argc, char **argv) { |
16 | init_log(L_INFO); | 17 | init_log(L_INFO); |
17 | if (!(state = client_setup(100, 100))) { | 18 | if (!(state = client_setup(100, 100, false))) { |
18 | return -1; | 19 | return -1; |
19 | } | 20 | } |
21 | if (!state->desktop_shell) { | ||
22 | sway_abort("swaybg requires the compositor to support the desktop-shell extension."); | ||
23 | } | ||
20 | struct output_state *output = state->outputs->items[0]; | 24 | struct output_state *output = state->outputs->items[0]; |
21 | state->width = output->width; | 25 | state->width = output->width; |
22 | state->height = output->height; | 26 | state->height = output->height; |
27 | desktop_shell_set_background(state->desktop_shell, output->output, state->surface); | ||
23 | 28 | ||
24 | uint8_t r = 0, g = 0, b = 0; | 29 | uint8_t r = 0, g = 0, b = 0; |
25 | 30 | ||