From d97f10081e5d34550276132128addf181a4de35b Mon Sep 17 00:00:00 2001 From: "Ucan, Emre (ADITG/SW1)" Date: Fri, 17 Jun 2016 13:50:16 +0000 Subject: 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 [Pekka: added extra commit message notes] Reviewed-by: Pekka Paalanen --- ivi-shell/hmi-controller.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ivi-shell') diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c index 548d68f9..0c28e817 100644 --- a/ivi-shell/hmi-controller.c +++ b/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; } -- cgit v1.2.3