summaryrefslogtreecommitdiffstats
path: root/sway/extensions.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/extensions.c')
-rw-r--r--sway/extensions.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/sway/extensions.c b/sway/extensions.c
new file mode 100644
index 00000000..a37ceaa8
--- /dev/null
+++ b/sway/extensions.c
@@ -0,0 +1,32 @@
1#include <wlc/wlc.h>
2#include <wlc/wlc-wayland.h>
3#include "wayland-desktop-shell-server-protocol.h"
4#include "log.h"
5
6static void set_background(struct wl_client *client, struct wl_resource *resource,
7 struct wl_resource *output, struct wl_resource *surface) {
8 sway_log(L_DEBUG, "Surface requesting background for output");
9}
10
11static struct desktop_shell_interface desktop_shell_implementation = {
12 .set_background = set_background,
13};
14
15static void desktop_shell_bind(struct wl_client *client, void *data,
16 unsigned int version, unsigned int id) {
17 if (version > 1) {
18 // Unsupported version
19 return;
20 }
21
22 struct wl_resource *resource = wl_resource_create(client, &desktop_shell_interface, version, id);
23 if (!resource) {
24 wl_client_post_no_memory(client);
25 }
26
27 wl_resource_set_implementation(resource, &desktop_shell_implementation, NULL, NULL);
28}
29
30void register_extensions(void) {
31 wl_global_create(wlc_get_wl_display(), &desktop_shell_interface, 1, NULL, desktop_shell_bind);
32}