[PATCH v2] shell: Fix crash when an input panel is hiding

Kristian Høgsberg hoegsberg at gmail.com
Tue Sep 25 08:09:54 PDT 2012


On Mon, Sep 24, 2012 at 02:50:39PM +0200, Jan Arne Petersen wrote:
> From: Jan Arne Petersen <jpetersen at openismus.com>
> 
> Do not unset the output of the input panel surfaces when hiding.
> ---
>  src/shell.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/src/shell.c b/src/shell.c
> index 2afa1b3..10b9822 100644
> --- a/src/shell.c
> +++ b/src/shell.c
> @@ -2782,8 +2782,13 @@ hide_input_panels(struct wl_listener *listener, void *data)
>  	wl_list_remove(&shell->input_panel_layer.link);
>  
>  	wl_list_for_each_safe(surface, next,
> -			      &shell->input_panel_layer.surface_list, layer_link)
> +			      &shell->input_panel_layer.surface_list, layer_link) {
> +		/* Unmap surface but restore old output which was set in
> +		 * input_panel_set_surface */
> +		struct weston_output *output = surface->output;
>  		weston_surface_unmap(surface);

Setting the output to NULL in unmap is how we mark the surface as not
mapped, so we need to preserve that.  As mentioned in the other reply,
the problem is that for some reason weston_surface_update_transform()
fails to find an output for the surface when we try to map it again.

Kristian

> +		surface->output = output;
> +	}
>  }
>  
>  static void
> -- 
> 1.7.11.4
> 
> _______________________________________________
> 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