desktop-shell: Check that fullscreen surface actually has a black view

When the position or size of a fullscreen surface changes (e.g., due to change
in the output), the surface commit logic in desktop_surface_committed() resets
the fullscreen by first calling unset_fullscreen() and later on calling
shell_configure_fullscreen(). One part of this reset is the recreation of the
black view curtain (destroyed in unset_fullscreen() and created again in
shell_configure_fullscreen()).

In the upcoming commit we will replace the call to shell_configure_fullscreen()
with a call to activate() (since we want to activate this shell surface, and
activate() already has a call to shell_configure_fullscreen() in it).

The code in activate() by default lowers the fullscreen layer of the shell
surface through lower_fullscreen_layer(), which is called before
shell_configure_fullscreen(). This lowering function assumes that the fullscreen
shell surface has a valid black view curtain, which as said before was removed
in the call to unset_fullscreen(). Add the check to guard against this case.

Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
This commit is contained in:
Sergio Gómez 2023-05-02 11:45:25 -05:00 committed by Marius Vlad
parent 4aafd872d0
commit e93da8fe3d

View File

@ -3692,7 +3692,8 @@ lower_fullscreen_layer(struct desktop_shell *shell,
/* We can have a non-fullscreen popup for a fullscreen surface
* in the fullscreen layer. */
if (weston_desktop_surface_get_fullscreen(shsurf->desktop_surface)) {
if (weston_desktop_surface_get_fullscreen(shsurf->desktop_surface) &&
shsurf->fullscreen.black_view) {
/* Hide the black view */
weston_layer_entry_remove(&shsurf->fullscreen.black_view->view->layer_link);
wl_list_init(&shsurf->fullscreen.black_view->view->layer_link.link);