aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-09-28 13:41:17 +0200
committeremersion <contact@emersion.fr>2017-09-28 13:41:17 +0200
commit643a69f0b230f5847487f8e8140699a1d2987263 (patch)
tree50ef92439037e6623bfebf2c047cba9b62a24c72
parent55d246218013afb8a0c75be852fbc22bca3bbcbd (diff)
Call wlr_surface_set_role in wl_shell_get_shell_surface
-rw-r--r--types/wlr_wl_shell.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/types/wlr_wl_shell.c b/types/wlr_wl_shell.c
index 23b14ad0..3f0bbf4e 100644
--- a/types/wlr_wl_shell.c
+++ b/types/wlr_wl_shell.c
@@ -9,6 +9,8 @@
#include <stdlib.h>
#include <wayland-server-protocol.h>
+static const char *wlr_wl_shell_surface_role = "wl_shell_surface";
+
static void shell_surface_pong(struct wl_client *client,
struct wl_resource *resource, uint32_t serial) {
wlr_log(L_DEBUG, "got shell surface pong");
@@ -296,6 +298,11 @@ static void wl_shell_get_shell_surface(struct wl_client *client,
struct wl_resource *resource, uint32_t id,
struct wl_resource *surface_resource) {
struct wlr_surface *surface = wl_resource_get_user_data(surface_resource);
+ if (wlr_surface_set_role(surface, wlr_wl_shell_surface_role,
+ resource, WL_SHELL_ERROR_ROLE)) {
+ return;
+ }
+
struct wlr_wl_shell *wl_shell = wl_resource_get_user_data(resource);
struct wlr_wl_shell_surface *wl_surface =
calloc(1, sizeof(struct wlr_wl_shell_surface));