aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
authorKonstantin Pospelov <kupospelov@gmail.com>2019-02-20 14:54:59 +0300
committerSimon Ser <contact@emersion.fr>2019-04-26 20:56:48 +0300
commitddf63ffabefd740bf2afa1addaf6e859d65aba6a (patch)
treed9bbf2dbe7ade0b7c4121a3afcaa2bfd4b5488f9 /sway/input
parentd27a5e1cb0f14e939d47497ebc49cfb422cc947b (diff)
downloadsway-ddf63ffabefd740bf2afa1addaf6e859d65aba6a.tar.xz
bindsym: consider xkb_rule_names for --to-code
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/keyboard.c30
1 files changed, 11 insertions, 19 deletions
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");
}