From 2e2da0c950da9847e3ba13ce022abdfd55531fe5 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Fri, 18 Apr 2025 15:07:46 +0300 Subject: [PATCH 1/3] desktop-shell: Convert to wl_signal_emit_mutable Removes a destroy signal from input-panel as there no users for it. Signed-off-by: Marius Vlad --- desktop-shell/input-panel.c | 7 ++----- desktop-shell/shell.c | 4 ++-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/desktop-shell/input-panel.c b/desktop-shell/input-panel.c index 9b5d3b20a..07ce45e35 100644 --- a/desktop-shell/input-panel.c +++ b/desktop-shell/input-panel.c @@ -36,7 +36,6 @@ struct input_panel_surface { struct wl_resource *resource; - struct wl_signal destroy_signal; struct desktop_shell *shell; @@ -208,8 +207,6 @@ input_panel_committed(struct weston_surface *surface, static void destroy_input_panel_surface(struct input_panel_surface *input_panel_surface) { - wl_signal_emit(&input_panel_surface->destroy_signal, input_panel_surface); - wl_list_remove(&input_panel_surface->surface_destroy_listener.link); wl_list_remove(&input_panel_surface->link); @@ -263,8 +260,8 @@ create_input_panel_surface(struct desktop_shell *shell, input_panel_surface->surface = surface; input_panel_surface->view = weston_view_create(surface); - wl_signal_init(&input_panel_surface->destroy_signal); - input_panel_surface->surface_destroy_listener.notify = input_panel_handle_surface_destroy; + input_panel_surface->surface_destroy_listener.notify = + input_panel_handle_surface_destroy; wl_signal_add(&surface->destroy_signal, &input_panel_surface->surface_destroy_listener); diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index abc3479b1..e09d5e6db 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -153,7 +153,7 @@ desktop_shell_destroy_surface(struct shell_surface *shsurf) wl_list_remove(&shsurf->link); weston_view_destroy(shsurf->view); - wl_signal_emit(&shsurf->destroy_signal, shsurf); + wl_signal_emit_mutable(&shsurf->destroy_signal, shsurf); weston_surface_unref(shsurf->wsurface_anim_fade); if (shsurf->output_destroy_listener.notify) { @@ -4318,7 +4318,7 @@ force_kill_binding(struct weston_keyboard *keyboard, if (!focus_surface) return; - wl_signal_emit(&compositor->kill_signal, focus_surface); + wl_signal_emit_mutable(&compositor->kill_signal, focus_surface); client = wl_resource_get_client(focus_surface->resource); wl_client_get_credentials(client, &pid, NULL, NULL); From df4b2d876e385b3fa410fc6a29d77c6886e148ae Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Fri, 18 Apr 2025 15:09:30 +0300 Subject: [PATCH 2/3] kiosk-shell: Convert to wl_signal_emit_mutable And add a missing handler removal in kiosk-shell-grab. Signed-off-by: Marius Vlad --- kiosk-shell/kiosk-shell-grab.c | 2 ++ kiosk-shell/kiosk-shell.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/kiosk-shell/kiosk-shell-grab.c b/kiosk-shell/kiosk-shell-grab.c index bff706fb3..ccb46a9bd 100644 --- a/kiosk-shell/kiosk-shell-grab.c +++ b/kiosk-shell/kiosk-shell-grab.c @@ -208,6 +208,8 @@ kiosk_shell_grab_handle_shsurf_destroy(struct wl_listener *listener, void *data) container_of(listener, struct kiosk_shell_grab, shsurf_destroy_listener); + wl_list_remove(&shgrab->shsurf_destroy_listener.link); + shgrab->shsurf = NULL; } diff --git a/kiosk-shell/kiosk-shell.c b/kiosk-shell/kiosk-shell.c index 50971e357..4d9b5f621 100644 --- a/kiosk-shell/kiosk-shell.c +++ b/kiosk-shell/kiosk-shell.c @@ -453,7 +453,7 @@ kiosk_shell_surface_reconfigure_for_output(struct kiosk_shell_surface *shsurf) static void kiosk_shell_surface_destroy(struct kiosk_shell_surface *shsurf) { - wl_signal_emit(&shsurf->destroy_signal, shsurf); + wl_signal_emit_mutable(&shsurf->destroy_signal, shsurf); wl_list_remove(&shsurf->surface_tree_link); weston_desktop_surface_set_user_data(shsurf->desktop_surface, NULL); @@ -931,7 +931,7 @@ desktop_surface_removed(struct weston_desktop_surface *desktop_surface, /* Inform children about destruction of their parent, so that we can * reparent them and potentially relink surface tree links before * finding a focus successor and activating a new surface. */ - wl_signal_emit(&shsurf->parent_destroy_signal, shsurf); + wl_signal_emit_mutable(&shsurf->parent_destroy_signal, shsurf); /* We need to take into account that the surface being destroyed it not * always the same as the focused surface, which could result in picking From 36617896fe15fab84a225b2b82ac99b44e606cf9 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Fri, 18 Apr 2025 15:11:07 +0300 Subject: [PATCH 3/3] ivi-shell: Convert to wl_signal_emit_mutable As far as I can tell all these have correspoding tests in tests/ivi-layout-test-plugin. Signed-off-by: Marius Vlad --- ivi-shell/ivi-layout.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index 20388ea55..72c57be96 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -250,7 +250,7 @@ ivi_layout_surface_destroy(struct ivi_layout_surface *ivisurf) ivi_view_destroy(ivi_view); } - wl_signal_emit(&layout->surface_notification.removed, ivisurf); + wl_signal_emit_mutable(&layout->surface_notification.removed, ivisurf); ivi_layout_remove_all_surface_transitions(ivisurf); @@ -883,14 +883,14 @@ commit_transition(struct ivi_layout* layout) static void send_surface_prop(struct ivi_layout_surface *ivisurf) { - wl_signal_emit(&ivisurf->property_changed, ivisurf); + wl_signal_emit_mutable(&ivisurf->property_changed, ivisurf); ivisurf->pending.prop.event_mask = 0; } static void send_layer_prop(struct ivi_layout_layer *ivilayer) { - wl_signal_emit(&ivilayer->property_changed, ivilayer); + wl_signal_emit_mutable(&ivilayer->property_changed, ivilayer); ivilayer->pending.prop.event_mask = 0; } @@ -1270,7 +1270,7 @@ ivi_layout_layer_create_with_dimension(uint32_t id_layer, wl_list_insert(&layout->layer_list, &ivilayer->link); - wl_signal_emit(&layout->layer_notification.created, ivilayer); + wl_signal_emit_mutable(&layout->layer_notification.created, ivilayer); return ivilayer; } @@ -1292,7 +1292,7 @@ ivi_layout_layer_destroy(struct ivi_layout_layer *ivilayer) ivi_view_destroy(ivi_view); } - wl_signal_emit(&layout->layer_notification.removed, ivilayer); + wl_signal_emit_mutable(&layout->layer_notification.removed, ivilayer); wl_list_remove(&ivilayer->pending.link); wl_list_remove(&ivilayer->order.link); @@ -1779,8 +1779,8 @@ ivi_layout_surface_set_id(struct ivi_layout_surface *ivisurf, ivisurf->id_surface = id_surface; - wl_signal_emit(&layout->surface_notification.configure_changed, - ivisurf); + wl_signal_emit_mutable(&layout->surface_notification.configure_changed, + ivisurf); return IVI_SUCCEEDED; } @@ -1918,7 +1918,7 @@ ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf, ivisurf->prop.event_mask |= IVI_NOTIFICATION_CONFIGURE; /* emit callback which is set by ivi-layout api user */ - wl_signal_emit(&layout->surface_notification.configure_desktop_changed, + wl_signal_emit_mutable(&layout->surface_notification.configure_desktop_changed, ivisurf); } @@ -1941,7 +1941,7 @@ ivi_layout_desktop_surface_create(struct weston_surface *wl_surface, IVI_LAYOUT_SURFACE_TYPE_DESKTOP); ivisurf->weston_desktop_surface = surface; - wl_signal_emit(&layout->surface_notification.created, ivisurf); + wl_signal_emit_mutable(&layout->surface_notification.created, ivisurf); return ivisurf; } @@ -2075,7 +2075,7 @@ ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf, ivisurf->prop.event_mask |= IVI_NOTIFICATION_CONFIGURE; /* emit callback which is set by ivi-layout api user */ - wl_signal_emit(&layout->surface_notification.configure_changed, + wl_signal_emit_mutable(&layout->surface_notification.configure_changed, ivisurf); } @@ -2096,7 +2096,7 @@ ivi_layout_surface_create(struct weston_surface *wl_surface, IVI_LAYOUT_SURFACE_TYPE_IVI); if (ivisurf) - wl_signal_emit(&layout->surface_notification.created, ivisurf); + wl_signal_emit_mutable(&layout->surface_notification.created, ivisurf); return ivisurf; }