[PATCH weston] shell: Allow ending of popup grabs from within the starting of the grab

Kristian Høgsberg hoegsberg at gmail.com
Wed Jul 3 16:08:42 PDT 2013


On Wed, Jun 26, 2013 at 07:49:11PM +0100, Rob Bradford wrote:
> From: Rob Bradford <rob at linux.intel.com>
> 
> Calling weston_pointer_start_grab can lead to a code path (in this case
> when the shell surface is unresponsive) that can try and remove the
> popup grab to setup a shell grab.
> 
> Ending the popup grab requires removing the surface from the grab's
> surfaces list - however the grab had not yet been fully setup so the
> grabbed surface was not yet in this list.
> 
> With this change we ensure we add the surface to the list before setting
> up the pointer grab.

What a great backtrace there... so there's something weird going on
that makes the newly opened popup be marked as unresponsive.  Either
way, this patch is good, in that we make sure our grab is fully set up
before we start it.

Kristian

> https://bugs.freedesktop.org/show_bug.cgi?id=66167
> ---
>  src/shell.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/src/shell.c b/src/shell.c
> index 9869db5..b20b1e1 100644
> --- a/src/shell.c
> +++ b/src/shell.c
> @@ -2121,9 +2121,11 @@ add_popup_grab(struct shell_surface *shsurf, struct shell_seat *shseat)
>  		if (shseat->seat->pointer->button_count > 0)
>  			shseat->popup_grab.initial_up = 0;
>  
> +		wl_list_insert(&shseat->popup_grab.surfaces_list, &shsurf->popup.grab_link);
>  		weston_pointer_start_grab(seat->pointer, &shseat->popup_grab.grab);
> +	} else {
> +		wl_list_insert(&shseat->popup_grab.surfaces_list, &shsurf->popup.grab_link);
>  	}
> -	wl_list_insert(&shseat->popup_grab.surfaces_list, &shsurf->popup.grab_link);
>  }
>  
>  static void
> -- 
> 1.8.3.1
> 
> _______________________________________________
> 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