mirror of
https://github.com/labwc/labwc.git
synced 2026-04-12 08:21:13 -04:00
Reload keymap on reconfigure
This commit is contained in:
parent
02d274e32c
commit
4b617b1e8c
3 changed files with 20 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ struct keyboard;
|
||||||
struct wlr_keyboard;
|
struct wlr_keyboard;
|
||||||
|
|
||||||
void keyboard_init(struct seat *seat);
|
void keyboard_init(struct seat *seat);
|
||||||
|
void keyboard_reload(struct seat *seat);
|
||||||
void keyboard_finish(struct seat *seat);
|
void keyboard_finish(struct seat *seat);
|
||||||
|
|
||||||
void keyboard_setup_handlers(struct keyboard *keyboard);
|
void keyboard_setup_handlers(struct keyboard *keyboard);
|
||||||
|
|
|
||||||
|
|
@ -613,6 +613,24 @@ keyboard_init(struct seat *seat)
|
||||||
keybind_update_keycodes(seat->server);
|
keybind_update_keycodes(seat->server);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
keyboard_reload(struct seat *seat)
|
||||||
|
{
|
||||||
|
struct wlr_keyboard *kb = wlr_seat_get_keyboard(seat->seat);
|
||||||
|
struct xkb_rule_names rules = { 0 };
|
||||||
|
struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
|
||||||
|
struct xkb_keymap *keymap = xkb_map_new_from_names(context, &rules,
|
||||||
|
XKB_KEYMAP_COMPILE_NO_FLAGS);
|
||||||
|
if (keymap) {
|
||||||
|
wlr_keyboard_set_keymap(kb, keymap);
|
||||||
|
xkb_keymap_unref(keymap);
|
||||||
|
} else {
|
||||||
|
wlr_log(WLR_ERROR, "Failed to create xkb keymap");
|
||||||
|
}
|
||||||
|
xkb_context_unref(context);
|
||||||
|
wlr_keyboard_set_repeat_info(kb, rc.repeat_rate, rc.repeat_delay);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
keyboard_setup_handlers(struct keyboard *keyboard)
|
keyboard_setup_handlers(struct keyboard *keyboard)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -537,6 +537,7 @@ seat_reconfigure(struct server *server)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
keyboard_reload(seat);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue