summaryrefslogtreecommitdiff
path: root/ivi-shell
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2023-02-07 10:27:16 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2023-03-14 10:40:04 +0100
commit1c02bdfb8ec796d88f98754873ab978b28542e1b (patch)
treeb3f8f4fc25425573d9794835358f32ede7ccccb9 /ivi-shell
parentb6423e59d9116d140e33e925d6dd9bf8324188a7 (diff)
downloadweston-1c02bdfb8ec796d88f98754873ab978b28542e1b.tar.gz
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>
Diffstat (limited to 'ivi-shell')
-rw-r--r--ivi-shell/ivi-shell.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c
index b8745d1d..c0fc6046 100644
--- a/ivi-shell/ivi-shell.c
+++ b/ivi-shell/ivi-shell.c
@@ -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);