libinput: support ignoring all libinput-based input devices by configuration

For some cases such as remote control, need to disable the interaction
between input device and the weston. It will not affect the use of input
device by other modules or applications.

Signed-off-by: Elliot Chen <elliot.chen@nxp.com>
This commit is contained in:
Elliot Chen 2025-10-16 12:20:17 +09:00 committed by Pekka Paalanen
parent 11f7273545
commit bef29b8774
4 changed files with 13 additions and 0 deletions

View file

@ -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;
}

View file

@ -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;

View file

@ -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");

View file

@ -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