shell: Avoid checking against surfaces that do not have an app_id 02/24902/1
authorMarius Vlad <marius.vlad@collabora.com>
Fri, 26 Jun 2020 12:58:54 +0000 (15:58 +0300)
committerMarius Vlad <marius.vlad@collabora.com>
Mon, 29 Jun 2020 19:10:11 +0000 (22:10 +0300)
Not all application will set-up an app_id and we might end up
checking against those. So avoid doing that because str* kind of like
functions do not like that. Discovered when playing with cluster
receiver and sub-surfaces.

Bug-AGL: SPEC-3382

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I31b454fd3ccb1770775a00b1c953d9cbef827909

src/shell.c

index 82cc1d3..4886a0a 100644 (file)
@@ -264,7 +264,7 @@ ivi_check_pending_desktop_surface_popup(struct ivi_surface *surface)
        const char *_app_id =
                        weston_desktop_surface_get_app_id(surface->dsurface);
 
-       if (wl_list_empty(&ivi->popup_pending_apps))
+       if (wl_list_empty(&ivi->popup_pending_apps) || !_app_id)
                return false;
 
        wl_list_for_each_safe(p_popup, next_p_popup,
@@ -295,7 +295,7 @@ ivi_check_pending_desktop_surface_split(struct ivi_surface *surface)
        const char *_app_id =
                        weston_desktop_surface_get_app_id(surface->dsurface);
 
-       if (wl_list_empty(&ivi->split_pending_apps))
+       if (wl_list_empty(&ivi->split_pending_apps) || !_app_id)
                return false;
 
        wl_list_for_each_safe(split_surf, next_split_surf,
@@ -319,7 +319,7 @@ ivi_check_pending_desktop_surface_fullscreen(struct ivi_surface *surface)
        const char *_app_id =
                        weston_desktop_surface_get_app_id(surface->dsurface);
 
-       if (wl_list_empty(&ivi->fullscreen_pending_apps))
+       if (wl_list_empty(&ivi->fullscreen_pending_apps) || !_app_id)
                return false;
 
        wl_list_for_each_safe(fs_surf, next_fs_surf,
@@ -342,7 +342,7 @@ ivi_check_pending_desktop_surface_remote(struct ivi_surface *surface)
        const char *_app_id =
                weston_desktop_surface_get_app_id(surface->dsurface);
 
-       if (wl_list_empty(&ivi->remote_pending_apps))
+       if (wl_list_empty(&ivi->remote_pending_apps) || !_app_id)
                return false;
 
        wl_list_for_each_safe(remote_surf, next_remote_surf,