diff options
Diffstat (limited to 'examples/rotation.c')
-rw-r--r-- | examples/rotation.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/examples/rotation.c b/examples/rotation.c index 2d2fb179..7cf5727b 100644 --- a/examples/rotation.c +++ b/examples/rotation.c @@ -1,5 +1,4 @@ #define _POSIX_C_SOURCE 200112L -#define _XOPEN_SOURCE 500 #include <GLES2/gl2.h> #include <getopt.h> #include <math.h> @@ -189,8 +188,14 @@ void new_input_notify(struct wl_listener *listener, void *data) { wlr_log(WLR_ERROR, "Failed to create XKB context"); exit(1); } - wlr_keyboard_set_keymap(device->keyboard, xkb_map_new_from_names(context, - &rules, XKB_KEYMAP_COMPILE_NO_FLAGS)); + struct xkb_keymap *keymap = xkb_map_new_from_names(context, &rules, + XKB_KEYMAP_COMPILE_NO_FLAGS); + if (!keymap) { + wlr_log(WLR_ERROR, "Failed to create XKB keymap"); + exit(1); + } + wlr_keyboard_set_keymap(device->keyboard, keymap); + xkb_keymap_unref(keymap); xkb_context_unref(context); break; default: |