ivi-shell: Add desktop surface ping timeout notification

Implement new ivi_layout_interface method and signal to forward
desktop client ping timeout events for unresponsive client handling.

Signed-off-by: LI Qingwu <Qing-wu.Li@leica-geosystems.com.cn>
This commit is contained in:
LI Qingwu 2025-02-19 13:42:09 +08:00 committed by Michael Olbrich
parent 2b69bc0811
commit 7e941cf6f1
5 changed files with 36 additions and 1 deletions

View file

@ -219,6 +219,17 @@ struct ivi_layout_interface {
*/
void (*add_listener_configure_desktop_surface)(struct wl_listener *listener);
/**
* \brief add a listener for desktop_surface ping timeout notification
*
* When a desktop_client fails to respond to compositor pings within
* the configured timeout period, this signal is emitted to registered
* listeners. The void* data argument will contain a pointer to the
* weston_desktop_client associated with the unresponsive surface.
*/
void (*add_listener_desktop_surface_ping_timeout)(struct wl_listener *listener);
/**
* \brief Get all ivi_surfaces which are currently registered and managed
* by the services

View file

@ -115,6 +115,7 @@ struct ivi_layout {
struct wl_signal removed;
struct wl_signal configure_changed;
struct wl_signal configure_desktop_changed;
struct wl_signal ping_timeout;
} surface_notification;
struct {

View file

@ -46,6 +46,9 @@ void
ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf,
int32_t width, int32_t height);
void
ivi_layout_desktop_surface_ping_timeout(struct weston_desktop_client *client);
struct ivi_layout_surface*
ivi_layout_desktop_surface_create(struct weston_surface *wl_surface,
struct weston_desktop_surface *surface);

View file

@ -988,6 +988,16 @@ ivi_layout_add_listener_configure_desktop_surface(struct wl_listener *listener)
wl_signal_add(&layout->surface_notification.configure_desktop_changed, listener);
}
static void
ivi_layout_add_listener_desktop_surface_ping_timeout(struct wl_listener *listener)
{
struct ivi_layout *layout = get_instance();
assert(listener);
wl_signal_add(&layout->surface_notification.ping_timeout, listener);
}
static int32_t
ivi_layout_shell_add_destroy_listener_once(struct wl_listener *listener, wl_notify_func_t destroy_handler)
{
@ -1912,6 +1922,14 @@ ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf,
ivisurf);
}
void
ivi_layout_desktop_surface_ping_timeout(struct weston_desktop_client *client)
{
struct ivi_layout *layout = get_instance();
wl_signal_emit_mutable(&layout->surface_notification.ping_timeout, client);
}
struct ivi_layout_surface*
ivi_layout_desktop_surface_create(struct weston_surface *wl_surface,
struct weston_desktop_surface *surface)
@ -2113,6 +2131,7 @@ ivi_layout_init(struct weston_compositor *ec, struct ivi_shell *shell)
wl_signal_init(&layout->surface_notification.removed);
wl_signal_init(&layout->surface_notification.configure_changed);
wl_signal_init(&layout->surface_notification.configure_desktop_changed);
wl_signal_init(&layout->surface_notification.ping_timeout);
wl_signal_init(&layout->input_panel_notification.configure_changed);
wl_signal_init(&layout->input_panel_notification.show);
@ -2168,6 +2187,7 @@ static struct ivi_layout_interface ivi_layout_interface = {
.add_listener_remove_surface = ivi_layout_add_listener_remove_surface,
.add_listener_configure_surface = ivi_layout_add_listener_configure_surface,
.add_listener_configure_desktop_surface = ivi_layout_add_listener_configure_desktop_surface,
.add_listener_desktop_surface_ping_timeout = ivi_layout_add_listener_desktop_surface_ping_timeout,
.get_surface = shell_get_ivi_layout_surface,
.get_surfaces = ivi_layout_get_surfaces,
.get_id_of_surface = ivi_layout_get_id_of_surface,

View file

@ -622,7 +622,7 @@ static void
desktop_surface_ping_timeout(struct weston_desktop_client *client,
void *user_data)
{
/* Not supported */
ivi_layout_desktop_surface_ping_timeout(client);
}
static void