aboutsummaryrefslogtreecommitdiff
path: root/sway/extensions.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-11-18 22:01:22 -0500
committerDrew DeVault <sir@cmpwn.com>2015-11-18 22:01:22 -0500
commit82db2a57a9ab171e77a0765df5dd0b2d92cb4f70 (patch)
tree024d67d41888e4a14d7e3e281d4115e7268797fd /sway/extensions.c
parentfb0bfa13ce8b5f71e4ba1570dd6d39f98a2f5fdf (diff)
Basic support for extensions in server and clients
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 @@
+#include <wlc/wlc.h>
+#include <wlc/wlc-wayland.h>
+#include "wayland-desktop-shell-server-protocol.h"
+#include "log.h"
+
+static void set_background(struct wl_client *client, struct wl_resource *resource,
+ struct wl_resource *output, struct wl_resource *surface) {
+ sway_log(L_DEBUG, "Surface requesting background for output");
+}
+
+static struct desktop_shell_interface desktop_shell_implementation = {
+ .set_background = set_background,
+};
+
+static void desktop_shell_bind(struct wl_client *client, void *data,
+ unsigned int version, unsigned int id) {
+ if (version > 1) {
+ // Unsupported version
+ return;
+ }
+
+ struct wl_resource *resource = wl_resource_create(client, &desktop_shell_interface, version, id);
+ if (!resource) {
+ wl_client_post_no_memory(client);
+ }
+
+ wl_resource_set_implementation(resource, &desktop_shell_implementation, NULL, NULL);
+}
+
+void register_extensions(void) {
+ wl_global_create(wlc_get_wl_display(), &desktop_shell_interface, 1, NULL, desktop_shell_bind);
+}