[PATCH weston] Add config option to disable input method

Pekka Paalanen ppaalanen at gmail.com
Sun Jun 7 23:17:33 PDT 2015


On Sat,  6 Jun 2015 10:18:17 +0000
Murray Calavera <murray.calavera at gmail.com> wrote:

> When building a shell-plugin the developer might not want to implement
> an input method. Nevertheless weston will look for one, print errors
> complaining that the input method died and then give up.
> 
> Signed-off-by: Murray Calavera <murray.calavera at gmail.com>
> ---
>  man/weston.ini.man | 9 ++++++++-
>  src/compositor.c   | 6 +++++-
>  weston.ini.in      | 1 +
>  3 files changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/man/weston.ini.man b/man/weston.ini.man
> index fe86bb6..f922440 100644
> --- a/man/weston.ini.man
> +++ b/man/weston.ini.man
> @@ -180,7 +180,7 @@ The
>  section is used to configure input devices when using the libinput input device
>  backend.
>  .PP
> -Available configuration are:
> +Available configurations are:
>  .TP 7
>  .BI "enable_tap=" true
>  enables tap to click on touchpad devices
> @@ -422,6 +422,13 @@ configurations. The default seat is called "default" and will always be
>  present. This seat can be constrained like any other.
>  .RE
>  .SH "INPUT-METHOD SECTION"
> +This section configures the onscreen keyboard input method.
> +.TP 7
> +.BI "enable=" true
> +whether to use the input method (boolean) . You may wish to disable this if
> +there is no input method available.
> +.RE
> +.RE
>  .TP 7
>  .BI "path=" "/usr/libexec/weston-keyboard"
>  sets the path of the on screen keyboard input method (string).
> diff --git a/src/compositor.c b/src/compositor.c
> index 8f02b4d..c00da85 100644
> --- a/src/compositor.c
> +++ b/src/compositor.c
> @@ -4505,6 +4505,7 @@ weston_compositor_init(struct weston_compositor *ec,
>  	struct wl_event_loop *loop;
>  	struct xkb_rule_names xkb_names;
>  	struct weston_config_section *s;
> +	int use_input_method;
>  
>  	ec->config = config;
>  	ec->wl_display = display;
> @@ -4578,7 +4579,10 @@ weston_compositor_init(struct weston_compositor *ec,
>  	weston_config_section_get_int(s, "repeat-delay",
>  				      &ec->kb_repeat_delay, 400);
>  
> -	text_backend_init(ec);
> +	s = weston_config_get_section(ec->config, "input-method", NULL, NULL);
> +	weston_config_section_get_bool(s, "enable", &use_input_method, 1);
> +	if(use_input_method)
> +		text_backend_init(ec);
>  
>  	wl_data_device_manager_init(ec->wl_display);
>  
> diff --git a/weston.ini.in b/weston.ini.in
> index 4fca0bb..c918061 100644
> --- a/weston.ini.in
> +++ b/weston.ini.in
> @@ -43,6 +43,7 @@ path=@libexecdir@/weston-screensaver
>  duration=600
>  
>  [input-method]
> +enable=true
>  path=@libexecdir@/weston-keyboard
>  
>  #[output]

Hi,

so when a user picks a shell plugin, it is inherent to the shell plugin
whether it supports the input method (surface roles) or not.

If you add a config option like this, then the user must somehow know,
that when using this particular plugin, he should set this other config
option too. That seems cumbersome, because the plugin itself certainly
knows if it supports an input method or not. Why should the user be
second-guessing the plugin?

Rather than this new config option, I would be much happier seeing the
shell plugin directly indicating whether it supports input methods or
not.

This could be realized by the shell plugin initializing the input
method directly, or iff that's too complicated, perhaps something like a
weston capability bit set by the shell.

Is the only reason for this patch to avoid the errors at startup, or
are there other reasons for users wanting to disable the input method
even when the shell plugin does support it?

If you really need a config option, how about setting [input-method]
"path" explicitly to empty to disable loading the input method client?


Thanks,
pq


More information about the wayland-devel mailing list