summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Díaz <daniel.diaz@linaro.org>2016-10-25 18:09:45 (GMT)
committerSona Sarmadi <sona.sarmadi@enea.com>2017-02-10 11:21:36 (GMT)
commit09cf53dfd3dc12d3b2f3743617d18cb1012e8b3f (patch)
treefbdfdf930fa8458f88f389aac2b7091ac854a5cf
parent10bef78e2135fb191166e3893cc4a1326deede8c (diff)
downloadpoky-09cf53dfd3dc12d3b2f3743617d18cb1012e8b3f.tar.gz
weston: Add no-input-device patch to 1.9.0.
The included patch, backported from Weston master, allows it to run without any input device at launch. An ini option is introduced for this purpose, so there is no behavioral change. Related change in weston.ini: [core] require-input=true Default is true; setting it false allows Weston to run without a keyboard or mouse, which is handy for automated environments. Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
-rw-r--r--meta/recipes-graphics/wayland/weston/add-config-option-for-no-input-device.patch125
-rw-r--r--meta/recipes-graphics/wayland/weston_1.9.0.bb1
2 files changed, 126 insertions, 0 deletions
diff --git a/meta/recipes-graphics/wayland/weston/add-config-option-for-no-input-device.patch b/meta/recipes-graphics/wayland/weston/add-config-option-for-no-input-device.patch
new file mode 100644
index 0000000..93376ef
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston/add-config-option-for-no-input-device.patch
@@ -0,0 +1,125 @@
1From 6c89292024cc08d4499916dc153c354175bd81c4 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Daniel=20D=C3=ADaz?= <daniel.diaz@linaro.org>
3Date: Fri, 21 Oct 2016 14:03:13 -0500
4Subject: [PATCH] Add configuration option for no input device.
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9[Backported from master, 75b7197.)
10
11As it has been discussed in the past [1], running Weston
12without any input device at launch might be beneficial for
13some use cases.
14
15Certainly, it's best for the vast majority of users (and
16the project) to require an input device to be present, as
17to avoid frustration and hassle, but for those brave souls
18that so prefer, this patch lets them run without any input
19device at all.
20
21This introduces a simple configuration in weston.ini:
22 [core]
23 require-input=true
24
25True is the default, so no behavioral change is introduced.
26
27[1] https://lists.freedesktop.org/archives/wayland-devel/2015-November/025193.html
28
29Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
30Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
31Reviewed-by: Daniel Stone <daniels@collabora.com>
32---
33 man/weston.ini.man | 5 +++++
34 src/compositor.h | 4 ++++
35 src/libinput-seat.c | 6 ++++++
36 src/main.c | 5 +++++
37 weston.ini.in | 1 +
38 5 files changed, 21 insertions(+)
39
40diff --git a/man/weston.ini.man b/man/weston.ini.man
41index a9b6026..668b16f 100644
42--- a/man/weston.ini.man
43+++ b/man/weston.ini.man
44@@ -169,6 +169,11 @@ time, the one specified in the command-line will be used. On the other
45 hand, if none of these sets the value, default idle timeout will be
46 set to 300 seconds.
47 .RS
48+.PP
49+.RE
50+.TP 7
51+.BI "require-input=" true
52+require an input device for launch
53
54 .SH "LIBINPUT SECTION"
55 The
56diff --git a/src/compositor.h b/src/compositor.h
57index c4c81f0..292a412 100644
58--- a/src/compositor.h
59+++ b/src/compositor.h
60@@ -701,6 +701,10 @@ struct weston_compositor {
61
62 void *user_data;
63 void (*exit)(struct weston_compositor *c);
64+
65+ /* Whether to let the compositor run without any input device. */
66+ bool require_input;
67+
68 };
69
70 struct weston_buffer {
71diff --git a/src/libinput-seat.c b/src/libinput-seat.c
72index c9f9ed2..1c4c358 100644
73--- a/src/libinput-seat.c
74+++ b/src/libinput-seat.c
75@@ -250,6 +250,12 @@ udev_input_enable(struct udev_input *input)
76 devices_found = 1;
77 }
78
79+ if (devices_found == 0 && !c->require_input) {
80+ weston_log("warning: no input devices found, but none required "
81+ "as per configuration.\n");
82+ return 0;
83+ }
84+
85 if (devices_found == 0) {
86 weston_log(
87 "warning: no input devices on entering Weston. "
88diff --git a/src/main.c b/src/main.c
89index a98570e..b8632e9 100644
90--- a/src/main.c
91+++ b/src/main.c
92@@ -658,6 +658,7 @@ int main(int argc, char *argv[])
93 struct wl_client *primary_client;
94 struct wl_listener primary_client_destroyed;
95 struct weston_seat *seat;
96+ int require_input;
97
98 const struct weston_option core_options[] = {
99 { WESTON_OPTION_STRING, "backend", 'B', &backend },
100@@ -737,6 +738,10 @@ int main(int argc, char *argv[])
101 if (weston_compositor_init_config(ec, config) < 0)
102 goto out_signals;
103
104+ weston_config_section_get_bool(section, "require-input",
105+ &require_input, true);
106+ ec->require_input = require_input;
107+
108 if (backend_init(ec, &argc, argv, config) < 0) {
109 weston_log("fatal: failed to create compositor backend\n");
110 goto out_signals;
111diff --git a/weston.ini.in b/weston.ini.in
112index 06b51df..e9ef992 100644
113--- a/weston.ini.in
114+++ b/weston.ini.in
115@@ -2,6 +2,7 @@
116 #modules=xwayland.so,cms-colord.so
117 #shell=desktop-shell.so
118 #gbm-format=xrgb2101010
119+#require-input=true
120
121 [shell]
122 background-image=/usr/share/backgrounds/gnome/Aqua.jpg
123--
1241.9.1
125
diff --git a/meta/recipes-graphics/wayland/weston_1.9.0.bb b/meta/recipes-graphics/wayland/weston_1.9.0.bb
index 16a788d..8a619b5 100644
--- a/meta/recipes-graphics/wayland/weston_1.9.0.bb
+++ b/meta/recipes-graphics/wayland/weston_1.9.0.bb
@@ -13,6 +13,7 @@ SRC_URI = "http://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
13 file://0001-make-error-portable.patch \ 13 file://0001-make-error-portable.patch \
14 file://libsystemd.patch \ 14 file://libsystemd.patch \
15 file://explicit-enable-disable-systemd.patch \ 15 file://explicit-enable-disable-systemd.patch \
16 file://add-config-option-for-no-input-device.patch \
16" 17"
17SRC_URI[md5sum] = "66bbba12f546570b4d97f676bc79a28e" 18SRC_URI[md5sum] = "66bbba12f546570b4d97f676bc79a28e"
18SRC_URI[sha256sum] = "9c1b03f3184fa0b0dfdf67e215048085156e1a2ca344af6613fed36794ac48cf" 19SRC_URI[sha256sum] = "9c1b03f3184fa0b0dfdf67e215048085156e1a2ca344af6613fed36794ac48cf"