From 40449fa64fcacb98372e576cc21e192ab783162f Mon Sep 17 00:00:00 2001 From: Leonardo Hernández Hernández Date: Mon, 23 May 2022 09:14:21 -0500 Subject: add a new function to get a client from a wlr_surface --- client.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'client.h') diff --git a/client.h b/client.h index e0964da..ec760ec 100644 --- a/client.h +++ b/client.h @@ -231,6 +231,13 @@ client_min_size(Client *c, int *width, int *height) *height = state->min_height; } +static inline Client * +client_from_wlr_surface(struct wlr_surface *surface) +{ + struct wlr_scene_node *n = surface->data; + return n ? n->data : NULL; +} + static inline Client * client_from_popup(struct wlr_xdg_popup *popup) { -- cgit v1.2.3