mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-20 04:40:07 +01:00
desktop-shell: Fix crash when fullscreen surface has no output
The shell_set_view_fullscreen function was dereferencing shsurf->fullscreen_output without checking if it was NULL first. This could lead to a crash when a fullscreen surface had no associated output during display hotplug. Fix issue: https://gitlab.freedesktop.org/wayland/weston/-/issues/1028 Signed-off-by: liang zhou <liang.zhou@gehealthcare.com>
This commit is contained in:
parent
5e7835bf2b
commit
0b540ba8d6
1 changed files with 7 additions and 1 deletions
|
|
@ -1710,7 +1710,13 @@ shell_set_view_fullscreen(struct shell_surface *shsurf)
|
|||
struct weston_surface *surface =
|
||||
weston_desktop_surface_get_surface(shsurf->desktop_surface);
|
||||
struct weston_compositor *ec = surface->compositor;
|
||||
struct weston_output *output = shsurf->fullscreen_output->output;
|
||||
struct weston_output *output = NULL;
|
||||
|
||||
if (!shsurf->fullscreen_output)
|
||||
return;
|
||||
|
||||
output = shsurf->fullscreen_output->output;
|
||||
|
||||
struct weston_curtain_params curtain_params = {
|
||||
.r = 0.0, .g = 0.0, .b = 0.0, .a = 1.0,
|
||||
.pos = output->pos,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue