From fe392d23b9187ea05df417954fca992dc53de643 Mon Sep 17 00:00:00 2001 From: "Tran Ba Khang(MS/EMC31-XC)" Date: Thu, 2 Feb 2023 11:07:18 +0700 Subject: [PATCH] ivi-shell: add commit_current into ivi_layout interface If a client commits a null buffer, weston will unmap all the views of the surface and marks it is unmapping. In the case, the client commits a new valid buffer, then the controller wants to rebuild the views without applies the pending properties of surfaces and layers. The ivi_layout_interface should prodive an interface for this. Suggested-by: Michael Olbrich's avatarMichael Olbrich Suggested-by: K J Rajendraprasad's avatarRajendraprasad K J Signed-off-by: Tran Ba Khang(MS/EMC31-XC) --- ivi-shell/ivi-layout-export.h | 8 ++++++++ ivi-shell/ivi-layout.c | 13 +++++++++++++ ivi-shell/ivi-shell.c | 12 ++++++++---- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/ivi-shell/ivi-layout-export.h b/ivi-shell/ivi-layout-export.h index a591873a..154cf8fa 100644 --- a/ivi-shell/ivi-layout-export.h +++ b/ivi-shell/ivi-layout-export.h @@ -152,6 +152,14 @@ struct ivi_layout_interface { */ int32_t (*commit_changes)(void); + /** + * \brief Rebuild view list without applying any new changes + * + * \return IVI_SUCCEEDED if the method call was successful + * \return IVI_FAILED if the method call was failed + */ + int32_t (*commit_current)(void); + /** * surface controller interface */ diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c index bd7a2311..8d81e23d 100644 --- a/ivi-shell/ivi-layout.c +++ b/ivi-shell/ivi-layout.c @@ -1823,6 +1823,16 @@ ivi_layout_commit_changes(void) return IVI_SUCCEEDED; } +static int32_t +ivi_layout_commit_current(void) +{ + struct ivi_layout *layout = get_instance(); + build_view_list(layout); + commit_changes(layout); + send_prop(layout); + return IVI_SUCCEEDED; +} + static int32_t ivi_layout_layer_set_transition(struct ivi_layout_layer *ivilayer, enum ivi_layout_transition_type type, @@ -1983,6 +1993,7 @@ ivi_layout_desktop_surface_configure(struct ivi_layout_surface *ivisurf, int32_t width, int32_t height) { struct ivi_layout *layout = get_instance(); + 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, @@ -2009,6 +2020,7 @@ ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf, int32_t width, int32_t height) { struct ivi_layout *layout = get_instance(); + 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, @@ -2107,6 +2119,7 @@ static struct ivi_layout_interface ivi_layout_interface = { * commit all changes */ .commit_changes = ivi_layout_commit_changes, + .commit_current = ivi_layout_commit_current, /** * surface controller interfaces diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c index 3dc7337a..23a2f204 100644 --- a/ivi-shell/ivi-shell.c +++ b/ivi-shell/ivi-shell.c @@ -121,8 +121,10 @@ ivi_shell_surface_committed(struct weston_surface *surface, { struct ivi_shell_surface *ivisurf = get_ivi_shell_surface(surface); - if (surface->width == 0 || surface->height == 0) - return; + if (surface->width == 0 || surface->height == 0) { + if (!weston_surface_is_unmapping(surface)) + return; + } if (ivisurf->width != surface->width || ivisurf->height != surface->height) { @@ -574,8 +576,10 @@ desktop_surface_committed(struct weston_desktop_surface *surface, if(!ivisurf) return; - if (weston_surf->width == 0 || weston_surf->height == 0) - return; + if (weston_surf->width == 0 || weston_surf->height == 0) { + if (!weston_surface_is_unmapping(weston_surf)) + return; + } if (ivisurf->width != weston_surf->width || ivisurf->height != weston_surf->height) {