diff options
Diffstat (limited to 'src/wayland')
| -rw-r--r-- | src/wayland/internal.h | 6 | ||||
| -rw-r--r-- | src/wayland/surface.c | 11 |
2 files changed, 5 insertions, 12 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) { diff --git a/src/wayland/surface.c b/src/wayland/surface.c index 242531c..8a2bb5b 100644 --- a/src/wayland/surface.c +++ b/src/wayland/surface.c @@ -319,17 +319,6 @@ static void conn_unlink(struct wayland_surface *w) w->conn = NULL; } -struct wayland_surface *conn_surface_for(struct wayland_display *c, struct wl_surface *s) -{ - if (unlikely(!c || !s)) return NULL; - struct wayland_surface *fast = (struct wayland_surface *)wl_surface_get_user_data(s); - if (likely(fast && fast->conn == c && fast->surface == s)) - return fast; - for (struct wayland_surface *w = c->surfaces; w; w = w->conn_next) - if (w->surface == s) - return w; - return NULL; -} static bool spec_valid(const struct yasl_surface_spec *spec) { |
