From ddf63ffabefd740bf2afa1addaf6e859d65aba6a Mon Sep 17 00:00:00 2001 From: Konstantin Pospelov Date: Wed, 20 Feb 2019 14:54:59 +0300 Subject: bindsym: consider xkb_rule_names for --to-code --- sway/input/keyboard.c | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'sway/input/keyboard.c') diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c index 5a965185..04b8b0ce 100644 --- a/sway/input/keyboard.c +++ b/sway/input/keyboard.c @@ -477,39 +477,31 @@ struct sway_keyboard *sway_keyboard_create(struct sway_seat *seat, } void sway_keyboard_configure(struct sway_keyboard *keyboard) { - struct xkb_rule_names rules; - memset(&rules, 0, sizeof(rules)); struct input_config *input_config = input_device_get_config(keyboard->seat_device->input_device); struct wlr_input_device *wlr_device = keyboard->seat_device->input_device->wlr_device; - if (input_config && input_config->xkb_layout) { - rules.layout = input_config->xkb_layout; + struct xkb_rule_names rules; + if (input_config) { + rules = input_config_get_rule_names(input_config); } else { + memset(&rules, 0, sizeof(rules)); + } + + if (!rules.layout) { rules.layout = getenv("XKB_DEFAULT_LAYOUT"); } - if (input_config && input_config->xkb_model) { - rules.model = input_config->xkb_model; - } else { + if (!rules.model) { rules.model = getenv("XKB_DEFAULT_MODEL"); } - - if (input_config && input_config->xkb_options) { - rules.options = input_config->xkb_options; - } else { + if (!rules.options) { rules.options = getenv("XKB_DEFAULT_OPTIONS"); } - - if (input_config && input_config->xkb_rules) { - rules.rules = input_config->xkb_rules; - } else { + if (!rules.rules) { rules.rules = getenv("XKB_DEFAULT_RULES"); } - - if (input_config && input_config->xkb_variant) { - rules.variant = input_config->xkb_variant; - } else { + if (!rules.variant) { rules.variant = getenv("XKB_DEFAULT_VARIANT"); } -- cgit v1.2.3-54-g00ecf