summaryrefslogtreecommitdiff
path: root/swaybg/main.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2015-11-18 22:01:22 -0500
committerDrew DeVault <[email protected]>2015-11-18 22:01:22 -0500
commit82db2a57a9ab171e77a0765df5dd0b2d92cb4f70 (patch)
tree024d67d41888e4a14d7e3e281d4115e7268797fd /swaybg/main.c
parentfb0bfa13ce8b5f71e4ba1570dd6d39f98a2f5fdf (diff)
Basic support for extensions in server and clients
Diffstat (limited to 'swaybg/main.c')
-rw-r--r--swaybg/main.c7
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 @@
+#include "wayland-desktop-shell-client-protocol.h"
#include <stdio.h>
#include <stdlib.h>
#include <wayland-client.h>
@@ -14,12 +15,16 @@ void sway_terminate(void) {
int main(int argc, char **argv) {
init_log(L_INFO);
- if (!(state = client_setup(100, 100))) {
+ if (!(state = client_setup(100, 100, false))) {
return -1;
}
+ if (!state->desktop_shell) {
+ sway_abort("swaybg requires the compositor to support the desktop-shell extension.");
+ }
struct output_state *output = state->outputs->items[0];
state->width = output->width;
state->height = output->height;
+ desktop_shell_set_background(state->desktop_shell, output->output, state->surface);
uint8_t r = 0, g = 0, b = 0;