aboutsummaryrefslogtreecommitdiffstats
path: root/swaybg/main.c
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2015-11-18 22:01:22 -0500
committerLibravatar Drew DeVault <sir@cmpwn.com>2015-11-18 22:01:22 -0500
commit82db2a57a9ab171e77a0765df5dd0b2d92cb4f70 (patch)
tree024d67d41888e4a14d7e3e281d4115e7268797fd /swaybg/main.c
parentFix warning about uninitialized variable (diff)
downloadsway-82db2a57a9ab171e77a0765df5dd0b2d92cb4f70.tar.gz
sway-82db2a57a9ab171e77a0765df5dd0b2d92cb4f70.tar.zst
sway-82db2a57a9ab171e77a0765df5dd0b2d92cb4f70.zip
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 @@
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
15int main(int argc, char **argv) { 16int 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