As a thin wrapper of ds_surface, E_Surface is bound to ds_surface.
That is, E_Surface become inert if ds_surface is destroyed.
E_Surface should be separated from the life cycle of E_Client, but it's
hard to do it for now because E_Surface is tightly coupled with
E_Client - It provides many functionalities related to comp_data member
variable of E_Client.
So, let the destroy signal of E_Surface emit when the destroy signal of
ds_surface is emitted.
Change-Id: Ie5cf65a20c9765e78b8d1caecfd20883b464357f
+ struct wl_signal destroy;
struct wl_signal parent_destroy;
} events;
};
struct wl_signal parent_destroy;
} events;
};
EINTERN void
e_surface_destroy_listener_add(E_Surface *surface, struct wl_listener *listener)
{
EINTERN void
e_surface_destroy_listener_add(E_Surface *surface, struct wl_listener *listener)
{
- wl_signal_add(&surface->base.destroy_signal, listener);
+ wl_signal_add(&surface->events.destroy, listener);
}
EINTERN struct wl_listener *
e_surface_destroy_listener_get(E_Surface *surface, wl_notify_func_t notify)
{
}
EINTERN struct wl_listener *
e_surface_destroy_listener_get(E_Surface *surface, wl_notify_func_t notify)
{
- return wl_signal_get(&surface->base.destroy_signal, notify);
+ return wl_signal_get(&surface->events.destroy, notify);
e_object_ref(E_OBJECT(ec));
surface->ec = ec;
e_object_ref(E_OBJECT(ec));
surface->ec = ec;
+ wl_signal_init(&surface->events.destroy);
wl_signal_init(&surface->events.parent_destroy);
wl_signal_init(&surface->base.destroy_signal);
wl_signal_init(&surface->base.apply_viewport_signal);
wl_signal_init(&surface->events.parent_destroy);
wl_signal_init(&surface->base.destroy_signal);
wl_signal_init(&surface->base.apply_viewport_signal);
surface = wl_container_of(listener, surface, destroy);
surface = wl_container_of(listener, surface, destroy);
- if (surface->surface_viewport)
- {
- ds_surface_viewport_release(surface->surface_viewport);
- surface->surface_viewport = NULL;
- }
+ wl_signal_emit(&surface->events.destroy, surface);
wl_list_remove(&surface->destroy.link);
wl_list_remove(&surface->commit.link);
wl_list_remove(&surface->destroy.link);
wl_list_remove(&surface->commit.link);