From 2b16c84905cd431794f0c7a6eac8cf3ba72af5dd Mon Sep 17 00:00:00 2001
From: Philippe Coval <philippe.coval@huawei.com>
Date: Thu, 18 Nov 2021 12:38:14 +0100
Subject: [PATCH] weston: Make keyboard optional

For optimisation purpose there is no need to launch
extra weston-keyboard on systems where input is handled differently
(eg: Using custom UI)

This can be disabled in blueprints conf if desired

Relate-to: https://forum.ostc-eu.org/t/226#bootchart
Forwarded: https://booting.oniroproject.org/distro/oniro/-/merge_requests/442
Signed-off-by: Philippe Coval <philippe.coval@huawei.com>
---
 .../recipes-graphics/wayland/weston-init.bbappend         | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/meta-oniro-core/recipes-graphics/wayland/weston-init.bbappend b/meta-oniro-core/recipes-graphics/wayland/weston-init.bbappend
index a3f928b4..91642e28 100644
--- a/meta-oniro-core/recipes-graphics/wayland/weston-init.bbappend
+++ b/meta-oniro-core/recipes-graphics/wayland/weston-init.bbappend
@@ -15,6 +15,7 @@ WESTON_INI_BACKGROUND_IMAGE ?= ""
 WESTON_INI_BACKGROUND_IMAGE_BASENAME = "${@os.path.basename("${WESTON_INI_BACKGROUND_IMAGE}")}"
 WESTON_INI_BACKGROUND_COLOR ?= "0xffffffff"
 WESTON_INI_BACKGROUND_TYPE ?= "centered"
+WESTON_INI_INPUT_METHOD_PATH ?= "/usr/libexec/weston-keyboard"
 
 do_install_append() {
 	# The filename references in WESTON_INI_BACKGROUND_IMAGE needs to be
@@ -65,6 +66,13 @@ python generate_dynamic_ini() {
             config.add_section('shell')
         config.set('shell', 'locking', d.getVar('WESTON_INI_SHELL_LOCKING'))
 
+    # Handle Input method
+    if d.getVar('WESTON_INI_INPUT_METHOD_PATH') != None:
+        bb.note('Handling WESTON_INI_INPUT_METHOD_PATH')
+        if 'input-method' not in config.sections():
+            config.add_section('input-method')
+        config.set('input-method', 'path', d.getVar('WESTON_INI_INPUT_METHOD_PATH'))
+
     # Handle background.
     background_image = d.getVar('WESTON_INI_BACKGROUND_IMAGE', True)
     if background_image:
-- 
GitLab