diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-12 14:44:58 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-12 14:44:58 +0300 |
| commit | a553abf3c46133f76b9a9e3c8166099efbcb9bcf (patch) | |
| tree | 836be926a7bfff99030ceff6b721492b49321c93 /src/wayland/internal.h | |
| parent | 93ea4e79528ba9f42d57f9004260dcba309492ba (diff) | |
wayland: make conn_surface_for static inline zero-lookup accessor
Diffstat (limited to 'src/wayland/internal.h')
| -rw-r--r-- | src/wayland/internal.h | 6 |
1 files changed, 5 insertions, 1 deletions
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) { |
