[PATCH weston] shell: Keep shsurf->fullscreen_output set after unset_fullscreen()

Kristian Høgsberg hoegsberg at gmail.com
Thu Apr 10 10:20:13 PDT 2014


On Thu, Apr 10, 2014 at 04:36:57PM +0300, Ander Conselvan de Oliveira wrote:
> When a fullscreen surface gets the maximized state, the function
> reset_surface_type() is called and that causes unset_fullscreen() to be
> called. That function would set the value of shsurf->fullscreen_output
> to NULL. However, since the surface still has the fullscreen state, it
> will be configured as a fullscreen surface again, and an attempt to
> access that field would cause the compositor to crash.
> 
> Fix the crash by keeping the value of fullscreen_output around after
> unset_fullscreen(). This is safe since the value is only used when a
> surface has the fullscreen state and is replaced on a new request to
> make the surface fullscreen.
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=76867
> 
> ---
> 
> This fixes the crash, but perhaps a better fix would be to not call
> unset_fullscreen() if the surface still has the fullscreen state. I
> did this simpler fix for now, since I don't know all the intricate
> details of the state change logic.

Yup, I like this simpler fix.  We're still planning an change to the
surface state protocol, so let's just fix it the simplest way for now.

> Cheers,
> Ander
> 
> ---
>  desktop-shell/shell.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
> index 09b992c..0680dc1 100644
> --- a/desktop-shell/shell.c
> +++ b/desktop-shell/shell.c
> @@ -2313,7 +2313,6 @@ unset_fullscreen(struct shell_surface *shsurf)
>  	    shell_surface_is_top_fullscreen(shsurf)) {
>  		restore_output_mode(shsurf->fullscreen_output);
>  	}
> -	shsurf->fullscreen_output = NULL;
>  
>  	shsurf->fullscreen.type = WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT;
>  	shsurf->fullscreen.framerate = 0;
> -- 
> 1.8.3.2
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list