From e93da8fe3d33e4e36b0a21eb2d15750913885e54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20G=C3=B3mez?= Date: Tue, 2 May 2023 11:45:25 -0500 Subject: [PATCH] desktop-shell: Check that fullscreen surface actually has a black view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- desktop-shell/shell.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index e695008a..11bf3289 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -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);