diff options
| -rw-r--r-- | meta/recipes-graphics/wayland/weston/add-config-option-for-no-input-device.patch | 125 | ||||
| -rw-r--r-- | meta/recipes-graphics/wayland/weston_1.9.0.bb | 1 |
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 0000000000..93376efd54 --- /dev/null +++ b/meta/recipes-graphics/wayland/weston/add-config-option-for-no-input-device.patch | |||
| @@ -0,0 +1,125 @@ | |||
| 1 | From 6c89292024cc08d4499916dc153c354175bd81c4 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Daniel=20D=C3=ADaz?= <daniel.diaz@linaro.org> | ||
| 3 | Date: Fri, 21 Oct 2016 14:03:13 -0500 | ||
| 4 | Subject: [PATCH] Add configuration option for no input device. | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | [Backported from master, 75b7197.) | ||
| 10 | |||
| 11 | As it has been discussed in the past [1], running Weston | ||
| 12 | without any input device at launch might be beneficial for | ||
| 13 | some use cases. | ||
| 14 | |||
| 15 | Certainly, it's best for the vast majority of users (and | ||
| 16 | the project) to require an input device to be present, as | ||
| 17 | to avoid frustration and hassle, but for those brave souls | ||
| 18 | that so prefer, this patch lets them run without any input | ||
| 19 | device at all. | ||
| 20 | |||
| 21 | This introduces a simple configuration in weston.ini: | ||
| 22 | [core] | ||
| 23 | require-input=true | ||
| 24 | |||
| 25 | True is the default, so no behavioral change is introduced. | ||
| 26 | |||
| 27 | [1] https://lists.freedesktop.org/archives/wayland-devel/2015-November/025193.html | ||
| 28 | |||
| 29 | Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org> | ||
| 30 | Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> | ||
| 31 | Reviewed-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 | |||
| 40 | diff --git a/man/weston.ini.man b/man/weston.ini.man | ||
| 41 | index 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 | ||
| 56 | diff --git a/src/compositor.h b/src/compositor.h | ||
| 57 | index 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 { | ||
| 71 | diff --git a/src/libinput-seat.c b/src/libinput-seat.c | ||
| 72 | index 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. " | ||
| 88 | diff --git a/src/main.c b/src/main.c | ||
| 89 | index 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; | ||
| 111 | diff --git a/weston.ini.in b/weston.ini.in | ||
| 112 | index 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 | -- | ||
| 124 | 1.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 16a788d2a3..8a619b553a 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 | " |
| 17 | SRC_URI[md5sum] = "66bbba12f546570b4d97f676bc79a28e" | 18 | SRC_URI[md5sum] = "66bbba12f546570b4d97f676bc79a28e" |
| 18 | SRC_URI[sha256sum] = "9c1b03f3184fa0b0dfdf67e215048085156e1a2ca344af6613fed36794ac48cf" | 19 | SRC_URI[sha256sum] = "9c1b03f3184fa0b0dfdf67e215048085156e1a2ca344af6613fed36794ac48cf" |
