aboutsummaryrefslogtreecommitdiff
path: root/rootston/config.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-10-26 22:38:03 +0200
committeremersion <contact@emersion.fr>2017-10-26 22:38:03 +0200
commitc0c4816b132649d1ffc5435720578286d83a19ef (patch)
treecfcc866add3adfffa022e3ad9caf7349fffedb8a /rootston/config.c
parent4e5d23daa9b4d70bf8b614d5375ee1ccdab6771f (diff)
Fix fallback when there are two config blocks for a keyboard
Diffstat (limited to 'rootston/config.c')
-rw-r--r--rootston/config.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/rootston/config.c b/rootston/config.c
index 863adc60..7a443151 100644
--- a/rootston/config.c
+++ b/rootston/config.c
@@ -417,14 +417,12 @@ struct device_config *config_get_device(struct roots_config *config,
struct keyboard_config *config_get_keyboard(struct roots_config *config,
struct wlr_input_device *device) {
struct keyboard_config *kc;
- struct keyboard_config *default_kc = NULL;
wl_list_for_each(kc, &config->keyboards, link) {
- if (strcmp(kc->name, "*") == 0) {
- default_kc = kc;
- } else if (strcmp(kc->name, device->name) == 0) {
+ if ((device != NULL && strcmp(kc->name, device->name) == 0) ||
+ (device == NULL && strcmp(kc->name, "*") == 0)) {
return kc;
}
}
- return default_kc;
+ return NULL;
}