ivi-shell: add surface_created listener after launchers

Add surface_created listener after the initialization of launchers.
Otherwise, surfaces of the launchers will be added to the application
layer too.

This does create a race where we might miss some surfaces that get
created before the UI client signals ready, but it was agreed the race
is not significant. You cannot use the launchers before the UI is ready,
and someone using systemd integration to launch clients in parallel to
Weston with ivi-shell and hmi-controller is unlikely. After all,
hmi-controller is just a demo.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
[Pekka: added extra commit message notes]
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
dev
Ucan, Emre (ADITG/SW1) 9 years ago committed by Pekka Paalanen
parent 28d240f281
commit d97f10081e
  1. 10
      ivi-shell/hmi-controller.c

@ -845,9 +845,6 @@ hmi_controller_create(struct weston_compositor *ec)
wl_list_insert(&hmi_ctrl->workspace_fade.layer_list,
&tmp_link_layer->link);
hmi_ctrl->surface_created.notify = set_notification_create_surface;
ivi_layout_interface->add_listener_create_surface(&hmi_ctrl->surface_created);
hmi_ctrl->surface_removed.notify = set_notification_remove_surface;
ivi_layout_interface->add_listener_remove_surface(&hmi_ctrl->surface_removed);
@ -1277,6 +1274,13 @@ ivi_hmi_controller_UI_ready(struct wl_client *client,
ivi_layout_interface->commit_changes();
ivi_hmi_controller_add_launchers(hmi_ctrl, 256);
/* Add surface_created listener after the initialization of launchers.
* Otherwise, surfaces of the launchers will be added to application
* layer too.*/
hmi_ctrl->surface_created.notify = set_notification_create_surface;
ivi_layout_interface->add_listener_create_surface(&hmi_ctrl->surface_created);
hmi_ctrl->is_initialized = 1;
}

Loading…
Cancel
Save