Merge branch 'wip/mvlad/signal-emit-callsites-shells' into 'main'

shell: Convert to wl_signal_emit_mutable

See merge request wayland/weston!1735
This commit is contained in:
Marius Vlad 2026-05-01 18:47:21 +03:00
commit ed52650ae3
5 changed files with 19 additions and 20 deletions

View file

@ -36,7 +36,6 @@
struct input_panel_surface {
struct wl_resource *resource;
struct wl_signal destroy_signal;
struct desktop_shell *shell;
@ -202,8 +201,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);
@ -257,8 +254,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);

View file

@ -155,7 +155,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) {
@ -4296,7 +4296,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);

View file

@ -251,7 +251,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);
@ -882,14 +882,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;
}
@ -1269,7 +1269,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;
}
@ -1291,7 +1291,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);
@ -1784,8 +1784,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;
}
@ -1923,7 +1923,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);
}
@ -1946,7 +1946,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;
}
@ -2080,7 +2080,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);
}
@ -2101,7 +2101,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;
}

View file

@ -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;
}

View file

@ -468,7 +468,7 @@ desktop_surface_update_label(struct wl_listener *listener, void *data)
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);
@ -943,7 +943,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