backends/native: Don't crash if keymap is misconfigured
xkb recently gained support for user-specified keymaps, which means we can no longer assume that the configuration data is necessarily fully complete or correct; and the configuration language is quite a labyrinth, so it's easy to get wrong. If setting the keymap fails, leave it in whatever state it previously had, since that seems preferable to crashing with a NULL pointer dereference. Resolves: https://gitlab.gnome.org/GNOME/mutter/-/issues/1555 Signed-off-by: Simon McVittie <smcv@debian.org> Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1605>
This commit is contained in:

committed by
Simon McVittie

parent
17dbb98811
commit
60f647df8e
@ -3124,6 +3124,7 @@ meta_seat_native_set_keyboard_map (MetaSeatNative *seat,
|
||||
ClutterKeymap *keymap;
|
||||
|
||||
g_return_if_fail (META_IS_SEAT_NATIVE (seat));
|
||||
g_return_if_fail (xkb_keymap != NULL);
|
||||
|
||||
keymap = clutter_seat_get_keymap (CLUTTER_SEAT (seat));
|
||||
meta_keymap_native_set_keyboard_map (META_KEYMAP_NATIVE (keymap),
|
||||
|
Reference in New Issue
Block a user