]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Parse touch configs in reverse order to enable overriding
authorSimon Long <simon@raspberrypi.com>
Tue, 29 Apr 2025 08:18:17 +0000 (09:18 +0100)
committerJohan Malm <johanmalm@users.noreply.github.com>
Tue, 29 Apr 2025 20:30:17 +0000 (21:30 +0100)
Also reverse searching of default configs

src/config/touch.c

index 2c93d8f309f000808a86a51dbb5f2a3d39e08ca3..0ff530e85d0a9d6b46cda392a3b45632b772f9e1 100644 (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;