Parse touch configs in reverse order to enable overriding

Also reverse searching of default configs
This commit is contained in:
Simon Long 2025-04-29 09:18:17 +01:00 committed by Johan Malm
parent 58d22d05e2
commit b97b2973df

View file

@ -9,7 +9,7 @@ static struct touch_config_entry *
find_default_config(void)
{
struct touch_config_entry *entry;
wl_list_for_each(entry, &rc.touch_configs, link) {
wl_list_for_each_reverse(entry, &rc.touch_configs, link) {
if (!entry->device_name) {
wlr_log(WLR_INFO, "found default touch configuration");
return entry;
@ -23,7 +23,7 @@ touch_find_config_for_device(char *device_name)
{
wlr_log(WLR_INFO, "find touch configuration for %s", device_name);
struct touch_config_entry *entry;
wl_list_for_each(entry, &rc.touch_configs, link) {
wl_list_for_each_reverse(entry, &rc.touch_configs, link) {
if (entry->device_name && !strcasecmp(entry->device_name, device_name)) {
wlr_log(WLR_INFO, "found touch configuration for %s", device_name);
return entry;