[PATCH weston] desktop-shell: use binding_modifier for zoom

Pekka Paalanen ppaalanen at gmail.com
Mon Sep 18 09:58:14 UTC 2017


On Fri, 15 Sep 2017 09:12:38 +0300
Ian Ray <ian.ray at ge.com> wrote:

> Support for kiosk-style use cases where binding modififer is `none':
> 
>  - Use binding modifier instead of hard-coded MODIFIER_SUPER for zoom.
>  - Disable opacity zoom if there is no binding modifier.
> 

Hello Ian,

strictly speaking, as you can see from the bullet list this patch does
two things so it should really be two patches. The summary line doesn't
really mention both things either.

This patch disables both zoom and opacity bindings when the modifier is
configured to 'none' in weston.ini. This is for kiosk use cases where
one does not want to have these bindings.

This patch changes the zoom binding to use the configured modifier
instead of hardcoding MODIFIER_SUPER. I suppose you don't actually need
this part.

Personally I'm fine with both changes, but I would like to see them in
separate patches where the summary lines clearly point out the user
visible changes and commit messages justify them.


Thanks,
pq

> Signed-off-by: Ian Ray <ian.ray at ge.com>
> ---
>  desktop-shell/shell.c | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
> index 415da19..1f99efe 100644
> --- a/desktop-shell/shell.c
> +++ b/desktop-shell/shell.c
> @@ -4860,12 +4860,6 @@ shell_add_bindings(struct weston_compositor *ec, struct desktop_shell *shell)
>  	weston_compositor_add_touch_binding(ec, 0,
>  					    touch_to_activate_binding,
>  					    shell);
> -	weston_compositor_add_axis_binding(ec, WL_POINTER_AXIS_VERTICAL_SCROLL,
> -				           MODIFIER_SUPER | MODIFIER_ALT,
> -				           surface_opacity_binding, NULL);
> -	weston_compositor_add_axis_binding(ec, WL_POINTER_AXIS_VERTICAL_SCROLL,
> -					   MODIFIER_SUPER, zoom_axis_binding,
> -					   NULL);
>  	weston_compositor_add_key_binding(ec, KEY_BRIGHTNESSDOWN, 0,
>  				          backlight_binding, ec);
>  	weston_compositor_add_key_binding(ec, KEY_BRIGHTNESSUP, 0,
> @@ -4880,6 +4874,16 @@ shell_add_bindings(struct weston_compositor *ec, struct desktop_shell *shell)
>  	if (!mod)
>  		return;
>  
> +	/* This binding is not configurable, but is only enabled if there is a
> +	 * valid binding modifier. */
> +	weston_compositor_add_axis_binding(ec, WL_POINTER_AXIS_VERTICAL_SCROLL,
> +				           MODIFIER_SUPER | MODIFIER_ALT,
> +				           surface_opacity_binding, NULL);
> +
> +	weston_compositor_add_axis_binding(ec, WL_POINTER_AXIS_VERTICAL_SCROLL,
> +					   mod, zoom_axis_binding,
> +					   NULL);
> +
>  	weston_compositor_add_key_binding(ec, KEY_PAGEUP, mod,
>  					  zoom_key_binding, NULL);
>  	weston_compositor_add_key_binding(ec, KEY_PAGEDOWN, mod,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20170918/06320356/attachment.sig>


More information about the wayland-devel mailing list