mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-24 17:00:06 +01:00
evdev: check model flags for actual booleans
The hwdb doesn't allow unsetting a property so once we start nesting model flags it'll become important to be able to be able to unset one as well (by assigning it to 0). So rather than checking for existence, check whether the property is actually set to something resembling a boolean. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Vasily Khoruzhick <anarsoul@gmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
a914e253fc
commit
c781ef2eb3
1 changed files with 4 additions and 2 deletions
|
|
@ -1813,10 +1813,12 @@ evdev_read_model_flags(struct evdev_device *device)
|
|||
};
|
||||
const struct model_map *m = model_map;
|
||||
uint32_t model_flags = 0;
|
||||
const char *val;
|
||||
|
||||
while (m->property) {
|
||||
if (!!udev_device_get_property_value(device->udev_device,
|
||||
m->property)) {
|
||||
val = udev_device_get_property_value(device->udev_device,
|
||||
m->property);
|
||||
if (val && !streq(val, "0")) {
|
||||
log_debug(device->base.seat->libinput,
|
||||
"%s: tagged as %s\n",
|
||||
evdev_device_get_sysname(device),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue