aboutsummaryrefslogtreecommitdiff
path: root/client.h
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-05-23 09:14:21 -0500
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-05-23 10:55:28 -0500
commit40449fa64fcacb98372e576cc21e192ab783162f (patch)
treed3e074ec9b6d5c1e4068e83b72bb51b1910f1e18 /client.h
parentecbc2c61db180dc8ab1053b7cdc1e4817be33d36 (diff)
add a new function to get a client from a wlr_surface
Diffstat (limited to 'client.h')
-rw-r--r--client.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/client.h b/client.h
index e0964da..ec760ec 100644
--- a/client.h
+++ b/client.h
@@ -232,6 +232,13 @@ client_min_size(Client *c, int *width, int *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)
{
struct wlr_xdg_surface *surface = popup->base;