rcxml: Make sure a default libinput category always exists

Previously, if rc.xml defined only non-default libinput categories,
no default category was created. This meant that configure_libinput()
might totally skip configuring some devices even with default
settings, like tap-to-click.

Fix this by making sure that a default category is always created.
This commit is contained in:
John Lindgren 2022-12-22 16:44:08 -05:00 committed by Johan Malm
parent 500eddbe88
commit 41a4176b17
4 changed files with 26 additions and 6 deletions

View file

@ -75,14 +75,16 @@ configure_libinput(struct wlr_input_device *wlr_input_device)
} else if (device_category->type == current_type) {
dc = device_category;
} else if (device_category->type == DEFAULT_DEVICE && !dc) {
/* Match default category as last-resort */
dc = device_category;
}
}
if (!dc) {
wlr_log(WLR_INFO, "Skipping libinput configuration for device");
return;
}
/*
* The above logic should have always matched SOME category
* (the default category if none other took precedence)
*/
assert(dc);
if (libinput_device_config_tap_get_finger_count(libinput_dev) <= 0) {
wlr_log(WLR_INFO, "tap unavailable");