add a new function to get a client from a wlr_surface

This commit is contained in:
Leonardo Hernández Hernández 2022-05-23 09:14:21 -05:00
parent ecbc2c61db
commit 40449fa64f
No known key found for this signature in database
GPG key ID: E538897EE11B9624
2 changed files with 9 additions and 7 deletions

View file

@ -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)
{