summaryrefslogtreecommitdiff
path: root/ivi-shell
diff options
context:
space:
mode:
authorTran Ba Khang(MS/EMC31-XC) <Khang.TranBa@vn.bosch.com>2022-11-10 16:30:53 +0700
committerMarius Vlad <marius.vlad@collabora.com>2022-11-10 11:47:05 +0200
commit91750cdbd4eba322ddc2389a5b5d5b9d04b6f434 (patch)
tree744d98d4f64b4e873ccfdfbe97c3146cc3e75442 /ivi-shell
parent9fa161ed095783a17e62063ee0772c757400aee4 (diff)
downloadweston-91750cdbd4eba322ddc2389a5b5d5b9d04b6f434.tar.gz
hmi-controller: switch to listening the shell destroy signal
Listening the shell destroy instead of compositor destroy signal. This show how to in case the controller depends on shell resource. The order destroying had changed in this commit, the controller is destroyed first now Signed-off-by: Tran Ba Khang(MS/EMC31-XC) <Khang.TranBa@vn.bosch.com>
Diffstat (limited to 'ivi-shell')
-rw-r--r--ivi-shell/hmi-controller.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/ivi-shell/hmi-controller.c b/ivi-shell/hmi-controller.c
index 2470187c..b974afd0 100644
--- a/ivi-shell/hmi-controller.c
+++ b/ivi-shell/hmi-controller.c
@@ -884,9 +884,12 @@ hmi_controller_create(struct weston_compositor *ec)
hmi_ctrl->desktop_surface_configured.notify = set_notification_configure_desktop_surface;
hmi_ctrl->interface->add_listener_configure_desktop_surface(&hmi_ctrl->desktop_surface_configured);
- hmi_ctrl->destroy_listener.notify = hmi_controller_destroy;
- wl_signal_add(&hmi_ctrl->compositor->destroy_signal,
- &hmi_ctrl->destroy_listener);
+ if(hmi_ctrl->interface->shell_add_destroy_listener_once(&hmi_ctrl->destroy_listener,
+ hmi_controller_destroy) == IVI_FAILED){
+ hmi_controller_destroy(&hmi_ctrl->destroy_listener, NULL);
+ return NULL;
+ }
+
return hmi_ctrl;
}
@@ -1978,10 +1981,6 @@ wet_module_init(struct weston_compositor *ec,
struct hmi_controller *hmi_ctrl = NULL;
struct wl_event_loop *loop = NULL;
- /* ad hoc weston_compositor_add_destroy_listener_once() */
- if (wl_signal_get(&ec->destroy_signal, hmi_controller_destroy))
- return 0;
-
hmi_ctrl = hmi_controller_create(ec);
if (hmi_ctrl == NULL)
return -1;