[PATCH weston 02/19] exposay: Test keyboard presence before using keyboard pointer

Jonas Ådahl jadahl at gmail.com
Wed Jul 1 01:51:02 PDT 2015


On Wed, Jun 03, 2015 at 03:53:21PM -0500, Derek Foreman wrote:
> We shouldn't actually use the keyboard pointer unless we check that
> a keyboard is present.
> 
> Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
> ---
>  desktop-shell/exposay.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/desktop-shell/exposay.c b/desktop-shell/exposay.c
> index 78e45fb..4916b39 100644
> --- a/desktop-shell/exposay.c
> +++ b/desktop-shell/exposay.c
> @@ -518,9 +518,13 @@ exposay_set_inactive(struct desktop_shell *shell)
>  {
>  	struct weston_seat *seat = shell->exposay.seat;
>  
> -	weston_keyboard_end_grab(seat->keyboard);
>  	if (seat->pointer_device_count)
>  		weston_pointer_end_grab(seat->pointer);
> +
> +	if (!seat->keyboard_device_count)
> +		return EXPOSAY_LAYOUT_INACTIVE;

nit: Would be better to be more consistent within this function, i.e.
put the keyboard parts inside a if (seat->pointer_device_count).

With that, this is Reviewed-by: Jonas Ådahl <jadahl at gmail.com>


Jonas

> +
> +	weston_keyboard_end_grab(seat->keyboard);
>  	if (seat->keyboard->input_method_resource)
>  		seat->keyboard->grab = &seat->keyboard->input_method_grab;
>  
> -- 
> 2.1.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