[PATCH weston] input: swallow the key press event when running a compositor key binding

Pekka Paalanen ppaalanen at gmail.com
Mon Dec 15 07:45:49 PST 2014


On Fri,  5 Dec 2014 18:02:58 +0200
Giulio Camuffo <giuliocamuffo at gmail.com> wrote:

> ---
>  src/bindings.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/bindings.c b/src/bindings.c
> index 5cb031a..8d4c133 100644
> --- a/src/bindings.c
> +++ b/src/bindings.c
> @@ -202,6 +202,9 @@ binding_key(struct weston_keyboard_grab *grab,
>  			if (keyboard->input_method_resource)
>  				keyboard->grab = &keyboard->input_method_grab;
>  			free(b);
> +		} else {
> +			/* Don't send the key press event for the binding key */
> +			return;
>  		}
>  	}
>  	if (!wl_list_empty(&keyboard->focus_resource_list)) {
> @@ -294,7 +297,7 @@ weston_compositor_run_key_binding(struct weston_compositor *compositor,
>  
>  			/* If this was a key binding and it didn't
>  			 * install a keyboard grab, install one now to
> -			 * swallow the key release. */
> +			 * swallow the key press. */
>  			if (seat->keyboard->grab ==
>  			    &seat->keyboard->default_grab)
>  				install_binding_grab(seat, time, key, focus);

< pq> daniels, did you have a R-b for http://patchwork.freedesktop.org/patch/38281/ ?
< daniels> pq: no, need to check it more later
< pq> ok
< daniels> pq: actually, nack from me - will explain later
< daniels> whoops, no, i can't parse indentation today apparently
< daniels> pq: R-b

Pushed. :-)

Thanks,
pq


More information about the wayland-devel mailing list