ivi-shell: abort if shell_surface_send_configure is called for non-ivi surfaces

shell_surface_send_configure() should only be called for ivi surfaces. Other (or
no) *configure() calls are needed for other types of surfaces.

Make sure that get_ivi_shell_surface() returns NULL if the surface is not an ivi
surface. And don't ignore wrong surfaces but assert instead to make it obvious
that new surface types need special handling in ivi_layout_surface_set_size().

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
This commit is contained in:
Michael Olbrich 2023-02-07 10:27:16 +01:00
parent b6423e59d9
commit 1c02bdfb8e

View file

@ -86,7 +86,10 @@ get_ivi_shell_surface(struct weston_surface *surface)
if (desktop_surface)
return weston_desktop_surface_get_user_data(desktop_surface);
return surface->committed_private;
if (surface->committed == ivi_shell_surface_committed)
return surface->committed_private;
return NULL;
}
struct ivi_layout_surface *
@ -108,8 +111,7 @@ shell_surface_send_configure(struct weston_surface *surface,
struct ivi_shell_surface *shsurf;
shsurf = get_ivi_shell_surface(surface);
if (!shsurf)
return;
assert(shsurf);
if (shsurf->resource)
ivi_surface_send_configure(shsurf->resource, width, height);