diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2020-06-05 15:27:31 +0300 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2020-06-15 14:46:30 +0300 |
commit | ba9b65aa89951b8d1a008b162ed0199008484d4c (patch) | |
tree | c83c2363c8076d0929be746128ef1352e0301cdd | |
parent | a04518d86f8b048902bae0167c6a6bc9f2276e89 (diff) |
shell: Add some extra checks to make sure we don't trip ourselves
Dynamically removing and inserting surfaces on outputs requires making
sure the surface is still mapped on that output.
Bug-AGL: SPEC-3280
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I125f9788718655ee88fa389fb14bd2c36342f8fe
-rw-r--r-- | src/shell.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/shell.c b/src/shell.c index 6944f8a..3f522ba 100644 --- a/src/shell.c +++ b/src/shell.c @@ -559,8 +559,16 @@ create_black_surface_view(struct ivi_output *output) void remove_black_surface(struct ivi_output *output) { - struct weston_view *view = output->fullscreen_view.fs->view; + struct weston_view *view; + if (!output && + !output->fullscreen_view.fs && + !output->fullscreen_view.fs->view) { + weston_log("Output %s doesn't have a surface installed!\n", output->name); + return; + } + + view = output->fullscreen_view.fs->view; assert(view->is_mapped == true || view->surface->is_mapped == true); @@ -576,8 +584,16 @@ remove_black_surface(struct ivi_output *output) void insert_black_surface(struct ivi_output *output) { - struct weston_view *view = output->fullscreen_view.fs->view; + struct weston_view *view; + if (!output && + !output->fullscreen_view.fs && + !output->fullscreen_view.fs->view) { + weston_log("Output %s doesn't have a surface installed!\n", output->name); + return; + } + + view = output->fullscreen_view.fs->view; if (view->is_mapped || view->surface->is_mapped) return; |