diff options
author | emersion <contact@emersion.fr> | 2018-04-03 10:38:46 -0400 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-04-03 10:38:46 -0400 |
commit | 58ac05c276c62c821735e77e15f7f502c82209aa (patch) | |
tree | e5712bbee8c665990ace1f7f3243aeec9cf9a65d /xwayland | |
parent | 1cd7ff7d3ab1cb922e4064ee77db453064cccb5b (diff) | |
parent | 506acbdecd4436117729e4c40678645725ed2d1f (diff) |
Merge branch 'master' into xwayland-dnd
Diffstat (limited to 'xwayland')
-rw-r--r-- | xwayland/xwm.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/xwayland/xwm.c b/xwayland/xwm.c index 54172343..e0bf938c 100644 --- a/xwayland/xwm.c +++ b/xwayland/xwm.c @@ -1,6 +1,7 @@ #ifndef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200809L #endif +#include <assert.h> #include <stdlib.h> #include <unistd.h> #include <wlr/config.h> @@ -73,6 +74,18 @@ const char *atom_map[ATOM_LAST] = { "XdndActionPrivate", }; +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; +} + // TODO: replace this with hash table? static struct wlr_xwayland_surface *lookup_surface(struct wlr_xwm *xwm, xcb_window_t window_id) { @@ -606,6 +619,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); |