mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-01 22:58:38 -04:00
Fix fallback when there are two config blocks for a keyboard
This commit is contained in:
parent
4e5d23daa9
commit
c0c4816b13
4 changed files with 49 additions and 33 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue