From a553abf3c46133f76b9a9e3c8166099efbcb9bcf Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Mon, 12 Oct 2026 14:44:58 +0300 Subject: wayland: make conn_surface_for static inline zero-lookup accessor --- src/wayland/internal.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/wayland/internal.h') diff --git a/src/wayland/internal.h b/src/wayland/internal.h index d519abd..ad6531b 100644 --- a/src/wayland/internal.h +++ b/src/wayland/internal.h @@ -370,7 +370,11 @@ void surface_fail(struct wayland_surface *w); void display_enter(struct wayland_display *c); void display_leave(struct wayland_display *c); -struct wayland_surface *conn_surface_for(struct wayland_display *c, struct wl_surface *s); +static inline struct wayland_surface *conn_surface_for(struct wayland_display *c, struct wl_surface *s) +{ + (void)c; + return s ? (struct wayland_surface *)wl_surface_get_user_data(s) : NULL; +} static inline struct wayland_surface *surface_root(struct wayland_surface *w) { -- cgit v1.2.3