Be able to run without compose table.

This commit is contained in:
Dave Davenport 2016-03-04 08:02:54 +01:00
parent fc75a204d5
commit 9d7d8a9aeb
2 changed files with 28 additions and 25 deletions

View File

@ -636,7 +636,7 @@ int main ( int argc, char *argv[] )
xcb_ewmh_init_atoms_replies ( &xcb->ewmh, ac, &errors );
if ( errors ) {
fprintf ( stderr, "Failed to create EWMH atoms\n" );
free(errors);
free ( errors );
}
if ( xkb_x11_setup_xkb_extension ( xcb->connection, XKB_X11_MIN_MAJOR_XKB_VERSION, XKB_X11_MIN_MINOR_XKB_VERSION,
@ -690,7 +690,7 @@ int main ( int argc, char *argv[] )
};
xcb_xkb_select_events ( xcb->connection, xkb.device_id, required_events, /* affectWhich */
0, /* clear */
0, /* selectAll */
required_events, /* selectAll */
required_map_parts, /* affectMap */
required_map_parts, /* map */
&details );
@ -699,11 +699,12 @@ int main ( int argc, char *argv[] )
xkb.state = xkb_x11_state_new_from_device ( xkb.keymap, xcb->connection, xkb.device_id );
xkb.compose.table = xkb_compose_table_new_from_locale ( xkb.context, setlocale ( LC_CTYPE, NULL ), 0 );
if ( xkb.compose.table == NULL ) {
fprintf(stderr, "Failed to load compose table.\n");
return EXIT_FAILURE;
}
if ( xkb.compose.table != NULL ) {
xkb.compose.state = xkb_compose_state_new ( xkb.compose.table, 0 );
}
else {
fprintf ( stderr, "Failed to get keyboard compose table. Trying to limp on.\n" );
}
x11_setup ( &xkb );
main_loop = g_main_loop_new ( NULL, FALSE );

View File

@ -1324,6 +1324,7 @@ static void rofi_view_mainloop_iter ( RofiViewState *state, xcb_generic_event_t
key = xkb_state_key_get_one_sym ( xkb->state, xkpe->detail );
if ( xkb->compose.state != NULL ) {
if ( ( key != XKB_KEY_NoSymbol ) && ( xkb_compose_state_feed ( xkb->compose.state, key ) == XKB_COMPOSE_FEED_ACCEPTED ) ) {
switch ( xkb_compose_state_get_status ( xkb->compose.state ) )
{
@ -1344,6 +1345,7 @@ static void rofi_view_mainloop_iter ( RofiViewState *state, xcb_generic_event_t
break;
}
}
}
if ( len == 0 ) {
len = xkb_state_key_get_utf8 ( xkb->state, xkpe->detail, pad, sizeof ( pad ) );