swc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/swc
Log | Files | Refs | README | LICENSE

commit fe0a0626dcf9921d97aa736be296a18165574b87
parent 5d81837b0b4f5ee43a69bafe6bf1e694c6b8abda
Author: Michael Forney <mforney@mforney.org>
Date:   Tue, 28 Jan 2020 14:16:25 -0800

xdg_decoration: Set the implementation, even though it is just empty handlers

Otherwise, if a client makes these requests, libwayland-server crashes.

Diffstat:
Mlibswc/xdg_decoration.c | 16++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)

diff --git a/libswc/xdg_decoration.c b/libswc/xdg_decoration.c @@ -28,6 +28,21 @@ #include "xdg-decoration-unstable-v1-server-protocol.h" static void +set_mode(struct wl_client *client, struct wl_resource *resource, uint32_t mode) +{ +} + +static void +unset_mode(struct wl_client *client, struct wl_resource *resource) +{ +} + +static const struct zxdg_toplevel_decoration_v1_interface decoration_impl = { + .set_mode = set_mode, + .unset_mode = unset_mode, +}; + +static void get_toplevel_decoration(struct wl_client *client, struct wl_resource *resource, uint32_t id, struct wl_resource *toplevel_resource) { struct wl_resource *decoration; @@ -37,6 +52,7 @@ get_toplevel_decoration(struct wl_client *client, struct wl_resource *resource, wl_resource_post_no_memory(resource); return; } + wl_resource_set_implementation(decoration, &decoration_impl, NULL, NULL); zxdg_toplevel_decoration_v1_send_configure(decoration, ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE); }