mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-05 19:18:03 +02:00
evdev: add a run-time check to avoid re-using model flags
Only runs on the LIBINPUT_MODEL_* flags, the ID_INPUT_TRACKBALL flag is an exception. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
f37c1dc66a
commit
b0a0627ae2
1 changed files with 7 additions and 0 deletions
|
|
@ -1291,8 +1291,15 @@ evdev_read_model_flags(struct evdev_device *device)
|
||||||
};
|
};
|
||||||
const struct model_map *m = model_map;
|
const struct model_map *m = model_map;
|
||||||
uint32_t model_flags = 0;
|
uint32_t model_flags = 0;
|
||||||
|
uint32_t all_model_flags = 0;
|
||||||
|
|
||||||
while (m->property) {
|
while (m->property) {
|
||||||
|
/* Check for flag re-use */
|
||||||
|
if (strneq("LIBINPUT_MODEL_", m->property, 15)) {
|
||||||
|
assert((all_model_flags & m->model) == 0);
|
||||||
|
all_model_flags |= m->model;
|
||||||
|
}
|
||||||
|
|
||||||
if (parse_udev_flag(device,
|
if (parse_udev_flag(device,
|
||||||
device->udev_device,
|
device->udev_device,
|
||||||
m->property)) {
|
m->property)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue