From: Kristian Høgsberg Date: Thu, 21 Jun 2012 16:49:02 +0000 (-0400) Subject: shell: Just use surface->private for shell_surface X-Git-Tag: 0.94.90~38 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d813445f16ea7d57fcdc8d0621de1aa9a4356363;p=profile%2Fivi%2Fweston.git shell: Just use surface->private for shell_surface --- diff --git a/src/shell.c b/src/shell.c index 6333180..ff88818 100644 --- a/src/shell.c +++ b/src/shell.c @@ -1743,23 +1743,18 @@ shell_handle_surface_destroy(struct wl_listener *listener, void *data) } } +static void +shell_surface_configure(struct weston_surface *, int32_t, int32_t); + static struct shell_surface * get_shell_surface(struct weston_surface *surface) { - struct wl_listener *listener; - - listener = wl_signal_get(&surface->surface.resource.destroy_signal, - shell_handle_surface_destroy); - if (listener) - return container_of(listener, struct shell_surface, - surface_destroy_listener); - - return NULL; + if (surface->configure == shell_surface_configure) + return surface->private; + else + return NULL; } -static void -shell_surface_configure(struct weston_surface *, int32_t, int32_t); - static struct shell_surface * create_shell_surface(void *shell, struct weston_surface *surface, const struct weston_shell_client *client) @@ -1778,6 +1773,7 @@ create_shell_surface(void *shell, struct weston_surface *surface, } surface->configure = shell_surface_configure; + surface->private = shsurf; surface->compositor->shell_interface.shell = shell; shsurf->shell = (struct desktop_shell *) shell;