[PATCH weston 07/19] input: clean up notify_modifiers a little

Jonas Ådahl jadahl at gmail.com
Wed Jul 1 01:52:35 PDT 2015


On Wed, Jun 03, 2015 at 03:53:26PM -0500, Derek Foreman wrote:
> We already have a pointer to the keyboard, so we can change all
> seat->keyboard to keyboard.
> 
> Signed-off-by: Derek Foreman <derekf at osg.samsung.com>

Reviewed-by: Jonas Ådahl <jadahl at gmail.com>

> ---
>  src/input.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/src/input.c b/src/input.c
> index c56de70..8350d22 100644
> --- a/src/input.c
> +++ b/src/input.c
> @@ -1138,19 +1138,19 @@ notify_modifiers(struct weston_seat *seat, uint32_t serial)
>  	group = xkb_state_serialize_layout(keyboard->xkb_state.state,
>  					   XKB_STATE_LAYOUT_EFFECTIVE);
>  
> -	if (mods_depressed != seat->keyboard->modifiers.mods_depressed ||
> -	    mods_latched != seat->keyboard->modifiers.mods_latched ||
> -	    mods_locked != seat->keyboard->modifiers.mods_locked ||
> -	    group != seat->keyboard->modifiers.group)
> +	if (mods_depressed != keyboard->modifiers.mods_depressed ||
> +	    mods_latched != keyboard->modifiers.mods_latched ||
> +	    mods_locked != keyboard->modifiers.mods_locked ||
> +	    group != keyboard->modifiers.group)
>  		changed = 1;
>  
> -	run_modifier_bindings(seat, seat->keyboard->modifiers.mods_depressed,
> +	run_modifier_bindings(seat, keyboard->modifiers.mods_depressed,
>  	                      mods_depressed);
>  
> -	seat->keyboard->modifiers.mods_depressed = mods_depressed;
> -	seat->keyboard->modifiers.mods_latched = mods_latched;
> -	seat->keyboard->modifiers.mods_locked = mods_locked;
> -	seat->keyboard->modifiers.group = group;
> +	keyboard->modifiers.mods_depressed = mods_depressed;
> +	keyboard->modifiers.mods_latched = mods_latched;
> +	keyboard->modifiers.mods_locked = mods_locked;
> +	keyboard->modifiers.group = group;
>  
>  	/* And update the modifier_state for bindings. */
>  	mods_lookup = mods_depressed | mods_latched;
> -- 
> 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