diff --git a/frontend/main.c b/frontend/main.c index b32b9399d..626d1e88e 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -1179,6 +1179,7 @@ weston_compositor_init_config(struct weston_compositor *ec, int repaint_msec; bool color_management; bool cal; + bool disable_input = false; /* weston.ini [keyboard] */ s = weston_config_get_section(config, "keyboard", NULL, NULL); @@ -1235,6 +1236,8 @@ weston_compositor_init_config(struct weston_compositor *ec, if (cal) weston_compositor_enable_touch_calibrator(ec, save_touch_device_calibration); + weston_config_section_get_bool(s, "disable-input", &disable_input, false); + compositor->compositor->disable_input = disable_input; return 0; } diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h index 1228ce176..ec391d979 100644 --- a/include/libweston/libweston.h +++ b/include/libweston/libweston.h @@ -1426,6 +1426,9 @@ struct weston_compositor { /* Whether to let the compositor run without any input device. */ bool require_input; + /* Ignore all libinput-based input devices */ + bool disable_input; + /* Whether to load multiple backends. */ bool multi_backend; diff --git a/libweston/libinput-seat.c b/libweston/libinput-seat.c index 5ecb97413..189b96d50 100644 --- a/libweston/libinput-seat.c +++ b/libweston/libinput-seat.c @@ -345,6 +345,10 @@ udev_input_init(struct udev_input *input, struct weston_compositor *c, input->compositor = c; input->configure_device = configure_device; + if (c->disable_input) { + weston_log("Frontend disabled all input devices.\n"); + return 0; + } log_priority = getenv("WESTON_LIBINPUT_LOG_PRIORITY"); diff --git a/man/weston.ini.man b/man/weston.ini.man index 1a79e358c..23466bcf2 100644 --- a/man/weston.ini.man +++ b/man/weston.ini.man @@ -335,6 +335,9 @@ For devices with \fBscroll-method\fR set to \fIbutton\fR. Specifies the button that will trigger scrolling. See /usr/include/linux/input-event-codes.h for the complete list of possible values. .TP 7 +.BI "disable-input=" false +Ignore all libinput-based input devices. +.TP 7 .BI "touchscreen_calibrator=" true Advertise the touchscreen calibrator interface to all clients. This is a potential denial-of-service attack vector, so it should only be enabled on