[PATCH weston] Add config option to disable input method

Murray Calavera murray.calavera at gmail.com
Sat Jun 6 03:18:17 PDT 2015


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]
-- 
2.4.2



More information about the wayland-devel mailing list