[PATCH weston 2/2] shell: Fix crash when a client is destroyed during the resize grab

Kristian Høgsberg hoegsberg at gmail.com
Tue Apr 29 13:37:42 PDT 2014


On Tue, Apr 29, 2014 at 05:54:03PM +0300, Ander Conselvan de Oliveira wrote:
> If a client exists during a resize grab, the resource for the shell
> surface being resized is destroyed. The shell surface is not destroyed
> immediately, however, because of the window close animation. In that
> case, the compositor would crash trying to send configure events to
> the surface being resized, since it would pass a NULL pointer to
> wl_resource_post_event().
> 
> The code for the resize grab was already able to handle the surface
> going away, so expand it to also handle the resource going away and
> fix the crash.
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=77344

Thanks, both patches applied.

Kristian 

> ---
>  desktop-shell/shell.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
> index 6fc797b..82d8166 100644
> --- a/desktop-shell/shell.c
> +++ b/desktop-shell/shell.c
> @@ -1594,7 +1594,7 @@ resize_grab_motion(struct weston_pointer_grab *grab, uint32_t time,
>  
>  	weston_pointer_move(pointer, x, y);
>  
> -	if (!shsurf)
> +	if (!shsurf || !shsurf->resource)
>  		return;
>  
>  	weston_view_from_global_fixed(shsurf->view,
> -- 
> 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