weston-terminal: Fix crash on first keystroke
authorDerek Foreman <derekf@osg.samsung.com>
Tue, 22 Nov 2016 19:00:38 +0000 (13:00 -0600)
committerDaniel Stone <daniels@collabora.com>
Tue, 22 Nov 2016 19:14:40 +0000 (19:14 +0000)
Since 894b3rcc634 weston-terminal will crash on first keystroke if you
fail to create an xkb compose state.  This can happen if you don't have
a Compose file.

Instead, now we just return uncomposed symbols.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
clients/window.c

index a82f05cbac3bbf9500064dddb6b83d8c69e07602..ac35c3d614c0f59a05e84a10ac53cdf376e559f2 100644 (file)
@@ -3108,6 +3108,8 @@ static xkb_keysym_t
 process_key_press(xkb_keysym_t sym, struct input *input)
 {
 #ifdef HAVE_XKBCOMMON_COMPOSE
+       if (!input->xkb.compose_state)
+               return sym;
        if (sym == XKB_KEY_NoSymbol)
                return sym;
        if (xkb_compose_state_feed(input->xkb.compose_state,