From 506acbdecd4436117729e4c40678645725ed2d1f Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Mon, 2 Apr 2018 20:57:09 -0400 Subject: Missed a spot --- xwayland/xwm.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'xwayland') diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 6702c3c9..4fa7d311 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -1,6 +1,7 @@ #ifndef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200809L #endif +#include #include #include #include @@ -58,6 +59,18 @@ const char *atom_map[ATOM_LAST] = { "_NET_WM_WINDOW_TYPE_COMBO", }; +const char *wlr_xwayland_surface_role = "wlr_xwayland_surface"; + +bool wlr_surface_is_xwayland_surface(struct wlr_surface *surface) { + return strcmp(surface->role, wlr_xwayland_surface_role) == 0; +} + +struct wlr_xwayland_surface *wlr_xwayland_surface_from_wlr_surface( + struct wlr_surface *surface) { + assert(wlr_surface_is_xwayland_surface(surface)); + return (struct wlr_xwayland_surface *)surface->role_data; +} + /* General helpers */ // TODO: replace this with hash table? static struct wlr_xwayland_surface *lookup_surface(struct wlr_xwm *xwm, @@ -574,6 +587,7 @@ static void xwm_map_shell_surface(struct wlr_xwm *xwm, read_surface_property(xwm, xsurface, props[i]); } + wlr_surface_set_role(xsurface->surface, wlr_xwayland_surface_role, NULL, 0); wlr_surface_set_role_committed(xsurface->surface, handle_surface_commit, xsurface); -- cgit v1.2.3