if (surface == NULL)
return NULL;
- wl_list_init(&surface->surface.destroy_listener_list);
wl_list_init(&surface->link);
wl_list_init(&surface->buffer_link);
surface->map_type = WLSC_SURFACE_MAP_UNMAPPED;
{
struct wlsc_surface *surface =
container_of(resource, struct wlsc_surface, surface.resource);
- struct wl_listener *l, *next;
struct wlsc_compositor *compositor = surface->compositor;
- uint32_t time;
wlsc_surface_damage(surface);
wl_list_remove(&surface->buffer_link);
- time = wlsc_compositor_get_time();
- wl_list_for_each_safe(l, next,
- &surface->surface.destroy_listener_list, link)
- l->func(l, &surface->surface, time);
-
free(surface);
}
surface_destroy(struct wl_client *client,
struct wl_surface *surface)
{
- wl_resource_destroy(&surface->resource, client);
+ wl_resource_destroy(&surface->resource, client,
+ wlsc_compositor_get_time());
}
WL_EXPORT void
static void
handle_zoom_surface_destroy(struct wl_listener *listener,
- struct wl_surface *surface, uint32_t time)
+ struct wl_resource *resource, uint32_t time)
{
struct meego_tablet_zoom *zoom =
container_of(listener, struct meego_tablet_zoom, listener);
zoom->spring.timestamp);
zoom->listener.func = handle_zoom_surface_destroy;
- wl_list_insert(surface->surface.destroy_listener_list.prev,
+ wl_list_insert(surface->surface.resource.destroy_listener_list.prev,
&zoom->listener.link);
wl_list_insert(shell->compositor->animation_list.prev,
static void
handle_lockscreen_surface_destroy(struct wl_listener *listener,
- struct wl_surface *surface, uint32_t time)
+ struct wl_resource *resource, uint32_t time)
{
struct meego_tablet_shell *shell =
container_of(listener,
shell->lockscreen_surface = es;
shell->lockscreen_listener.func = handle_lockscreen_surface_destroy;
- wl_list_insert(es->surface.destroy_listener_list.prev,
+ wl_list_insert(es->surface.resource.destroy_listener_list.prev,
&shell->lockscreen_listener.link);
}
static void
handle_switcher_surface_destroy(struct wl_listener *listener,
- struct wl_surface *surface, uint32_t time)
+ struct wl_resource *resource, uint32_t time)
{
struct meego_tablet_shell *shell =
container_of(listener,
es, es->width, es->height);
shell->switcher_listener.func = handle_switcher_surface_destroy;
- wl_list_insert(es->surface.destroy_listener_list.prev,
+ wl_list_insert(es->surface.resource.destroy_listener_list.prev,
&shell->switcher_listener.link);
}
tablet_client_destroy(struct wl_client *client,
struct meego_tablet_client *tablet_client)
{
- wl_resource_destroy(&tablet_client->resource, client);
+ wl_resource_destroy(&tablet_client->resource,
+ client, wlsc_compositor_get_time());
}
static void
wl_list_remove(&drag->drag_focus_listener.link);
if (surface)
- wl_list_insert(surface->destroy_listener_list.prev,
+ wl_list_insert(surface->resource.destroy_listener_list.prev,
&drag->drag_focus_listener.link);
}
static void
drag_destroy(struct wl_client *client, struct wl_drag *drag)
{
- wl_resource_destroy(&drag->resource, client);
+ wl_resource_destroy(&drag->resource, client,
+ wlsc_compositor_get_time());
}
static const struct wl_drag_interface drag_interface = {
static void
drag_handle_surface_destroy(struct wl_listener *listener,
- struct wl_surface *surface, uint32_t time)
+ struct wl_resource *resource, uint32_t time)
{
struct wl_drag *drag =
container_of(listener, struct wl_drag, drag_focus_listener);
+ struct wl_surface *surface = (struct wl_surface *) resource;
if (drag->drag_focus == surface)
wl_drag_set_pointer_focus(drag, NULL, time, 0, 0, 0, 0);
WL_SELECTION_OFFER_OFFER, *p);
wl_list_remove(&selection->selection_focus_listener.link);
- wl_list_insert(surface->destroy_listener_list.prev,
+ wl_list_insert(surface->resource.destroy_listener_list.prev,
&selection->selection_focus_listener.link);
wl_client_post_event(surface->client,
wl_list_remove(&selection->selection_focus_listener.link);
if (surface)
- wl_list_insert(surface->destroy_listener_list.prev,
+ wl_list_insert(surface->resource.destroy_listener_list.prev,
&selection->selection_focus_listener.link);
}
static void
selection_destroy(struct wl_client *client, struct wl_selection *selection)
{
- wl_resource_destroy(&selection->resource, client);
+ wl_resource_destroy(&selection->resource, client,
+ wlsc_compositor_get_time());
}
static const struct wl_selection_interface selection_interface = {
static void
selection_handle_surface_destroy(struct wl_listener *listener,
- struct wl_surface *surface, uint32_t time)
+ struct wl_resource *resource, uint32_t time)
{
}
wlsc_switcher_next(struct wlsc_switcher *switcher)
{
struct wl_list *l;
+ struct wl_surface *current;
wlsc_surface_damage(switcher->current);
l = switcher->current->link.next;
l = switcher->compositor->surface_list.next;
switcher->current = container_of(l, struct wlsc_surface, link);
wl_list_remove(&switcher->listener.link);
- wl_list_insert(switcher->current->surface.destroy_listener_list.prev,
+ current = &switcher->current->surface;
+ wl_list_insert(current->resource.destroy_listener_list.prev,
&switcher->listener.link);
switcher->compositor->overlay = switcher->current;
wlsc_surface_damage(switcher->current);
static void
switcher_handle_surface_destroy(struct wl_listener *listener,
- struct wl_surface *surface, uint32_t time)
+ struct wl_resource *resource, uint32_t time)
{
struct wlsc_switcher *switcher =
container_of(listener, struct wlsc_switcher, listener);