aboutsummaryrefslogtreecommitdiff
path: root/examples/output-layout.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2021-04-16 09:05:39 +0200
committerSimon Ser <contact@emersion.fr>2021-04-19 17:33:28 +0200
commitfbc2182b9fbe9437181caf23a8cb0b9ada90800f (patch)
treef908eebdb93716b47854be4e65d52f706293dc2d /examples/output-layout.c
parent83670fce65edc76127bf9595a2f993eaa80a3d59 (diff)
Stop specifying xkb_rule_names
If a NULL xkb_rule_names pointer is passed to xkb_keymap_new_from_names, libxkbcommon will default to reading the XKB_* env variables. So there's no need to do it ourselves. Also s/xkb_map_new_from_names/xkb_keymap_new_from_names/ since the latter is more consistent with the returned struct name. [1]: https://xkbcommon.org/doc/current/structxkb__rule__names.html
Diffstat (limited to 'examples/output-layout.c')
-rw-r--r--examples/output-layout.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/examples/output-layout.c b/examples/output-layout.c
index 11774f7e..121ea15b 100644
--- a/examples/output-layout.c
+++ b/examples/output-layout.c
@@ -229,18 +229,12 @@ static void new_input_notify(struct wl_listener *listener, void *data) {
keyboard->destroy.notify = keyboard_destroy_notify;
wl_signal_add(&device->keyboard->events.key, &keyboard->key);
keyboard->key.notify = keyboard_key_notify;
- struct xkb_rule_names rules = { 0 };
- rules.rules = getenv("XKB_DEFAULT_RULES");
- rules.model = getenv("XKB_DEFAULT_MODEL");
- rules.layout = getenv("XKB_DEFAULT_LAYOUT");
- rules.variant = getenv("XKB_DEFAULT_VARIANT");
- rules.options = getenv("XKB_DEFAULT_OPTIONS");
struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
if (!context) {
wlr_log(WLR_ERROR, "Failed to create XKB context");
exit(1);
}
- struct xkb_keymap *keymap = xkb_map_new_from_names(context, &rules,
+ struct xkb_keymap *keymap = xkb_keymap_new_from_names(context, NULL,
XKB_KEYMAP_COMPILE_NO_FLAGS);
if (!keymap) {
wlr_log(WLR_ERROR, "Failed to create XKB keymap");