diff options
-rw-r--r-- | ivi-layermanagement-api/ilmCommon/src/ilm_common.c | 5 | ||||
-rw-r--r-- | weston-ivi-shell/src/ivi-controller.c | 27 | ||||
-rw-r--r-- | weston-ivi-shell/src/ivi-controller.h | 2 |
3 files changed, 30 insertions, 4 deletions
diff --git a/ivi-layermanagement-api/ilmCommon/src/ilm_common.c b/ivi-layermanagement-api/ilmCommon/src/ilm_common.c index f9940d8..b4f8818 100644 --- a/ivi-layermanagement-api/ilmCommon/src/ilm_common.c +++ b/ivi-layermanagement-api/ilmCommon/src/ilm_common.c @@ -91,7 +91,10 @@ ilm_initWithNativedisplay(t_ilm_nativedisplay nativedisplay) ILM_EXPORT t_ilm_bool ilm_isInitialized(void) { - return gIlmCommonPlatformFunc.isInitialized(); + if(gIlmCommonPlatformFunc.isInitialized) + return gIlmCommonPlatformFunc.isInitialized(); + + return ILM_FALSE; } ILM_EXPORT ilmErrorTypes diff --git a/weston-ivi-shell/src/ivi-controller.c b/weston-ivi-shell/src/ivi-controller.c index 87ebd2e..69f0cda 100644 --- a/weston-ivi-shell/src/ivi-controller.c +++ b/weston-ivi-shell/src/ivi-controller.c @@ -1566,7 +1566,7 @@ output_destroyed_event(struct wl_listener *listener, void *data) destroy_screen(iviscrn); } - if (shell->bkgnd_view) + if (shell->bkgnd_view && shell->client) set_bkgnd_surface_prop(shell); else weston_compositor_schedule_repaint(shell->compositor); @@ -1577,7 +1577,7 @@ output_resized_event(struct wl_listener *listener, void *data) { struct ivishell *shell = wl_container_of(listener, shell, output_destroyed); - if (shell->bkgnd_view) + if (shell->bkgnd_view && shell->client) set_bkgnd_surface_prop(shell); } @@ -1589,7 +1589,7 @@ output_created_event(struct wl_listener *listener, void *data) create_screen(shell, created_output); - if (shell->bkgnd_view) + if (shell->bkgnd_view && shell->client) set_bkgnd_surface_prop(shell); else weston_compositor_schedule_repaint(shell->compositor); @@ -2033,6 +2033,11 @@ ivi_shell_destroy(struct wl_listener *listener, void *data) struct ivishell *shell = wl_container_of(listener, shell, destroy_listener); + if (shell->client) { + wl_list_remove(&shell->client_destroy_listener.link); + wl_client_destroy(shell->client); + } + wl_list_remove(&shell->destroy_listener.link); wl_list_remove(&shell->output_created.link); @@ -2165,6 +2170,18 @@ load_input_module(struct ivishell *shell) } static void +ivi_shell_client_destroy(struct wl_listener *listener, void *data) +{ + struct ivishell *shell = wl_container_of(listener, shell, + client_destroy_listener); + + weston_log("ivi shell client %p destroyed \n", shell->client); + + wl_list_remove(&shell->client_destroy_listener.link); + shell->client = NULL; +} + +static void launch_client_process(void *data) { struct ivishell *shell = @@ -2185,6 +2202,10 @@ launch_client_process(void *data) shell->client = weston_client_start(shell->compositor, shell->ivi_client_name); + shell->client_destroy_listener.notify = ivi_shell_client_destroy; + wl_client_add_destroy_listener(shell->client, + &shell->client_destroy_listener); + free(shell->ivi_client_name); } diff --git a/weston-ivi-shell/src/ivi-controller.h b/weston-ivi-shell/src/ivi-controller.h index aeaba03..9abb843 100644 --- a/weston-ivi-shell/src/ivi-controller.h +++ b/weston-ivi-shell/src/ivi-controller.h @@ -80,6 +80,8 @@ struct ivishell { struct wl_listener destroy_listener; + struct wl_listener client_destroy_listener; + struct wl_array screen_ids; uint32_t screen_id_offset; |