summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-08-12 23:58:11 -0500
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-08-12 23:58:11 -0500
commit28af37cd1f6dce140df8e99659d0af07dc1d9985 (patch)
tree8d53809cdddd4fd2a292b761bc67ee1d6a259a9c
parent48396a1bf8ce4282c4fc76d853195e1026caf7d7 (diff)
handle client_from_wlr_surface() receiving a subsurface
-rw-r--r--client.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/client.h b/client.h
index dc4a6c4..c091b81 100644
--- a/client.h
+++ b/client.h
@@ -30,6 +30,7 @@ static inline Client *
client_from_wlr_surface(struct wlr_surface *s)
{
struct wlr_xdg_surface *surface;
+ struct wlr_surface *parent;
#ifdef XWAYLAND
struct wlr_xwayland_surface *xsurface;
@@ -42,6 +43,8 @@ client_from_wlr_surface(struct wlr_surface *s)
&& surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL)
return surface->data;
+ if (s && wlr_surface_is_subsurface(s))
+ return client_from_wlr_surface(wlr_surface_get_root_surface(s));
return NULL;
}