aboutsummaryrefslogtreecommitdiff
path: root/rootston/config.c
diff options
context:
space:
mode:
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;
}