|
|
@ -459,7 +459,6 @@ weston_surface_create(struct weston_compositor *compositor) |
|
|
|
|
|
|
|
|
|
|
|
wl_signal_init(&surface->destroy_signal); |
|
|
|
wl_signal_init(&surface->destroy_signal); |
|
|
|
wl_signal_init(&surface->commit_signal); |
|
|
|
wl_signal_init(&surface->commit_signal); |
|
|
|
wl_signal_init(&surface->drop_idle_inhibitor_signal); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
surface->compositor = compositor; |
|
|
|
surface->compositor = compositor; |
|
|
|
surface->ref_count = 1; |
|
|
|
surface->ref_count = 1; |
|
|
@ -4730,33 +4729,23 @@ struct weston_idle_inhibitor { |
|
|
|
struct weston_surface *surface; |
|
|
|
struct weston_surface *surface; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/* Called when the client requests destruction of the idle inhibitor */ |
|
|
|
|
|
|
|
static void |
|
|
|
static void |
|
|
|
idle_inhibitor_destroy(struct wl_client *client, struct wl_resource *resource) |
|
|
|
destroy_idle_inhibitor(struct wl_resource *resource) |
|
|
|
{ |
|
|
|
{ |
|
|
|
struct weston_idle_inhibitor *inhibitor = wl_resource_get_user_data(resource); |
|
|
|
struct weston_idle_inhibitor *inhibitor = wl_resource_get_user_data(resource); |
|
|
|
|
|
|
|
|
|
|
|
assert(inhibitor); |
|
|
|
inhibitor->surface = NULL; |
|
|
|
|
|
|
|
free(inhibitor); |
|
|
|
inhibitor->surface->inhibit_idling = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Notify to re-queue any idle behaviors
|
|
|
|
|
|
|
|
wl_signal_emit(&inhibitor->surface->drop_idle_inhibitor_signal, |
|
|
|
|
|
|
|
inhibitor->surface); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
weston_log("idle_inhibitor_destroy\n"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* Called when the idle inhibitor is destroyed on the server-side */ |
|
|
|
|
|
|
|
static void |
|
|
|
static void |
|
|
|
destroy_idle_inhibitor(struct wl_resource *resource) |
|
|
|
idle_inhibitor_destroy(struct wl_client *client, struct wl_resource *resource) |
|
|
|
{ |
|
|
|
{ |
|
|
|
struct weston_idle_inhibitor *inhibitor = wl_resource_get_user_data(resource); |
|
|
|
struct weston_idle_inhibitor *inhibitor = wl_resource_get_user_data(resource); |
|
|
|
|
|
|
|
|
|
|
|
weston_log("destroy_idle_inhibitor\n"); |
|
|
|
assert(inhibitor); |
|
|
|
|
|
|
|
|
|
|
|
inhibitor->surface = NULL; |
|
|
|
inhibitor->surface->inhibit_idling = false; |
|
|
|
free(inhibitor); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static const struct zwp_idle_inhibitor_v1_interface idle_inhibitor_interface = { |
|
|
|
static const struct zwp_idle_inhibitor_v1_interface idle_inhibitor_interface = { |
|
|
|