Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions sway/config/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,13 @@ void merge_input_config(struct input_config *dst, struct input_config *src) {
free(dst->xkb_file);
dst->xkb_file = src->xkb_file ? strdup(src->xkb_file) : NULL;
dst->xkb_file_is_set = dst->xkb_file != NULL;
dst->xkb_layout = NULL;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xkb_file overrides not just xkb_layout, but also xkb_model, xkb_options, xkb_rules, and xkb_variant.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but I would have assumed that these other options don't take effect if xkb_file is set and xkb_layout isn't. Looking at sway_keyboard_compile_keymap that does seem to be the case?

In any case I think it would be nice to log or display an error in case conflicting xkb_ options are specified in the same config block. But I'd defer that to another PR.

}
if (src->xkb_layout) {
free(dst->xkb_layout);
dst->xkb_layout = strdup(src->xkb_layout);
dst->xkb_file = NULL;
dst->xkb_file_is_set = false;
}
if (src->xkb_model) {
free(dst->xkb_model);
Expand Down