Merge branch 'master' into keyboard-fixes

This commit is contained in:
Tony Crisci 2017-12-18 10:04:27 -05:00
commit 20327d82cb
3 changed files with 17 additions and 11 deletions

View file

@ -1,4 +1,3 @@
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <sys/mman.h>
@ -132,13 +131,16 @@ void wlr_keyboard_led_update(struct wlr_keyboard *kb, uint32_t leds) {
void wlr_keyboard_set_keymap(struct wlr_keyboard *kb,
struct xkb_keymap *keymap) {
wlr_log(L_DEBUG, "Keymap set");
if (kb->keymap) {
xkb_keymap_unref(kb->keymap);
}
kb->keymap = keymap;
xkb_keymap_ref(keymap);
assert(kb->xkb_state = xkb_state_new(kb->keymap));
kb->keymap = keymap;
kb->xkb_state = xkb_state_new(kb->keymap);
if (kb->xkb_state == NULL) {
wlr_log(L_ERROR, "Failed to create XKB state");
return;
}
const char *led_names[WLR_LED_COUNT] = {
XKB_LED_NAME_NUM,