[PATCH weston v2] compositor: Update grab variable in notify_key() after binding handler.

Kristian Høgsberg hoegsberg at gmail.com
Mon Jun 11 17:17:59 PDT 2012


On Mon, Jun 11, 2012 at 02:59:31PM -0600, Scott Moreau wrote:
> We need to update the temp grab pointer after weston_compositor_run_key_binding()
> before calling the key handler because it may have installed a new grab.

Thanks for figuring this out.
Kristian

> ---
> 
> Only update the variable if the binding handler was called.
> 
>  src/compositor.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/src/compositor.c b/src/compositor.c
> index 26c9a95..09de2f6 100644
> --- a/src/compositor.c
> +++ b/src/compositor.c
> @@ -1839,9 +1839,11 @@ notify_key(struct wl_seat *seat, uint32_t time, uint32_t key,
>  		*k = key;
>  	}
>  
> -	if (grab == &seat->keyboard->default_grab)
> +	if (grab == &seat->keyboard->default_grab) {
>  		weston_compositor_run_key_binding(compositor, ws, time, key,
>  						  state);
> +		grab = seat->keyboard->grab;
> +	}
>  
>  	grab->interface->key(grab, time, key, state);
>  	if (mods)
> -- 
> 1.7.7.6
> 
> _______________________________________________
> 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