compositor: change weston_surface::destroy_signal argument
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Fri, 17 Apr 2015 11:23:38 +0000 (14:23 +0300)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Thu, 30 Apr 2015 11:51:40 +0000 (14:51 +0300)
Pass 'this' weston_surface as the data argument to
weston_surface::destroy_signal listeners. The old &surface->resource was
really just an offsetted pointer to the weston_surface anyway. And,
because 'resource' happened to be the first member in struct weston_surface,
it was actually 'this' weston_surface.

The argument type was accidentally changed in commit
26ed73cee858956f6af07c3e4bb49b5514f17b8b from wl_resource* to
wl_resource**.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
src/compositor.c
src/compositor.h

index c94f00ff1efa6803f9628045668f624cbacbc250..1c062651a96afbb4148920a198f0dba33fe0f687 100644 (file)
@@ -1876,7 +1876,7 @@ weston_surface_destroy(struct weston_surface *surface)
 
        assert(surface->resource == NULL);
 
-       wl_signal_emit(&surface->destroy_signal, &surface->resource);
+       wl_signal_emit(&surface->destroy_signal, surface);
 
        assert(wl_list_empty(&surface->subsurface_list_pending));
        assert(wl_list_empty(&surface->subsurface_list));
@@ -3483,7 +3483,7 @@ subsurface_handle_surface_destroy(struct wl_listener *listener, void *data)
        struct weston_subsurface *sub =
                container_of(listener, struct weston_subsurface,
                             surface_destroy_listener);
-       assert(data == &sub->surface->resource);
+       assert(data == sub->surface);
 
        /* The protocol object (wl_resource) is left inert. */
        if (sub->resource)
@@ -3498,7 +3498,7 @@ subsurface_handle_parent_destroy(struct wl_listener *listener, void *data)
        struct weston_subsurface *sub =
                container_of(listener, struct weston_subsurface,
                             parent_destroy_listener);
-       assert(data == &sub->parent->resource);
+       assert(data == sub->parent);
        assert(sub->surface != sub->parent);
 
        if (weston_surface_is_mapped(sub->surface))
index 5f49237de8e5b474b65f587477ac2ce43faa6657..31ef5c7bf2ffd1e1196048d134df0aa63571b5ea 100644 (file)
@@ -883,7 +883,7 @@ struct weston_surface_state {
 
 struct weston_surface {
        struct wl_resource *resource;
-       struct wl_signal destroy_signal;
+       struct wl_signal destroy_signal; /* callback argument: this surface */
        struct weston_compositor *compositor;
 
        /** Damage in local coordinates from the client, for tex upload. */