hmi-controller: doesn't do a configuring when surface has no content

ivi-shell has allowed to notify a surface configuring when detecting
an unmapping commit. To avoid the commit_change with source_width
and source_height are zero, we should don't do a configuring when
surface has no content.

Signed-off-by: Tran Ba Khang(MS/EMC31-XC) <Khang.TranBa@vn.bosch.com>
This commit is contained in:
Tran Ba Khang(MS/EMC31-XC) 2023-02-02 11:10:47 +07:00 committed by Marius Vlad
parent fe392d23b9
commit f866dfaa09

View file

@ -605,6 +605,8 @@ set_notification_configure_surface(struct wl_listener *listener, void *data)
*/
surface = hmi_ctrl->interface->surface_get_weston_surface(ivisurf);
if (surface) {
if (!weston_surface_has_content(surface))
return;
hmi_ctrl->interface->surface_set_source_rectangle(
ivisurf, 0, 0, surface->width,
surface->height);
@ -664,6 +666,8 @@ set_notification_configure_desktop_surface(struct wl_listener *listener, void *d
*/
surface = hmi_ctrl->interface->surface_get_weston_surface(ivisurf);
if (surface) {
if (!weston_surface_has_content(surface))
return;
hmi_ctrl->interface->surface_set_source_rectangle(ivisurf, 0,
0, surface->width, surface->height);
}