@ -1078,13 +1078,13 @@ notify_modifiers(struct weston_seat *seat, uint32_t serial)
/* Serialize and update our internal state, checking to see if it's
* different to the previous state . */
mods_depressed = xkb_state_serialize_mods ( keyboard - > xkb_state . state ,
XKB_STATE_DEPRESSED ) ;
XKB_STATE_MODS_ DEPRESSED ) ;
mods_latched = xkb_state_serialize_mods ( keyboard - > xkb_state . state ,
XKB_STATE_LATCHED ) ;
XKB_STATE_MODS_ LATCHED ) ;
mods_locked = xkb_state_serialize_mods ( keyboard - > xkb_state . state ,
XKB_STATE_LOCKED ) ;
group = xkb_state_serialize_group ( keyboard - > xkb_state . state ,
XKB_STATE_EFFECTIVE ) ;
XKB_STATE_MODS_ LOCKED ) ;
group = xkb_state_serialize_layout ( keyboard - > xkb_state . state ,
XKB_STATE_LAYOUT _EFFECTIVE ) ;
if ( mods_depressed ! = seat - > keyboard - > modifiers . mods_depressed | |
mods_latched ! = seat - > keyboard - > modifiers . mods_latched | |
@ -1870,7 +1870,7 @@ weston_xkb_info_destroy(struct weston_xkb_info *xkb_info)
return ;
if ( xkb_info - > keymap )
xkb_map_unref ( xkb_info - > keymap ) ;
xkb_key map_unref ( xkb_info - > keymap ) ;
if ( xkb_info - > keymap_area )
munmap ( xkb_info - > keymap_area , xkb_info - > keymap_size ) ;
@ -1907,33 +1907,37 @@ weston_xkb_info_create(struct xkb_keymap *keymap)
if ( xkb_info = = NULL )
return NULL ;
xkb_info - > keymap = xkb_map_ref ( keymap ) ;
xkb_info - > keymap = xkb_key map_ref ( keymap ) ;
xkb_info - > ref_count = 1 ;
char * keymap_str ;
xkb_info - > shift_mod = xkb_map_mod_get_index ( xkb_info - > keymap ,
XKB_MOD_NAME_SHIFT ) ;
xkb_info - > caps_mod = xkb_map_mod_get_index ( xkb_info - > keymap ,
XKB_MOD_NAME_CAPS ) ;
xkb_info - > ctrl_mod = xkb_map_mod_get_index ( xkb_info - > keymap ,
XKB_MOD_NAME_CTRL ) ;
xkb_info - > alt_mod = xkb_map_mod_get_index ( xkb_info - > keymap ,
XKB_MOD_NAME_ALT ) ;
xkb_info - > mod2_mod = xkb_map_mod_get_index ( xkb_info - > keymap , " Mod2 " ) ;
xkb_info - > mod3_mod = xkb_map_mod_get_index ( xkb_info - > keymap , " Mod3 " ) ;
xkb_info - > super_mod = xkb_map_mod_get_index ( xkb_info - > keymap ,
XKB_MOD_NAME_LOGO ) ;
xkb_info - > mod5_mod = xkb_map_mod_get_index ( xkb_info - > keymap , " Mod5 " ) ;
xkb_info - > num_led = xkb_map_led_get_index ( xkb_info - > keymap ,
XKB_LED_NAME_NUM ) ;
xkb_info - > caps_led = xkb_map_led_get_index ( xkb_info - > keymap ,
XKB_LED_NAME_CAPS ) ;
xkb_info - > scroll_led = xkb_map_led_get_index ( xkb_info - > keymap ,
XKB_LED_NAME_SCROLL ) ;
keymap_str = xkb_map_get_as_string ( xkb_info - > keymap ) ;
xkb_info - > shift_mod = xkb_keymap_mod_get_index ( xkb_info - > keymap ,
XKB_MOD_NAME_SHIFT ) ;
xkb_info - > caps_mod = xkb_keymap_mod_get_index ( xkb_info - > keymap ,
XKB_MOD_NAME_CAPS ) ;
xkb_info - > ctrl_mod = xkb_keymap_mod_get_index ( xkb_info - > keymap ,
XKB_MOD_NAME_CTRL ) ;
xkb_info - > alt_mod = xkb_keymap_mod_get_index ( xkb_info - > keymap ,
XKB_MOD_NAME_ALT ) ;
xkb_info - > mod2_mod = xkb_keymap_mod_get_index ( xkb_info - > keymap ,
" Mod2 " ) ;
xkb_info - > mod3_mod = xkb_keymap_mod_get_index ( xkb_info - > keymap ,
" Mod3 " ) ;
xkb_info - > super_mod = xkb_keymap_mod_get_index ( xkb_info - > keymap ,
XKB_MOD_NAME_LOGO ) ;
xkb_info - > mod5_mod = xkb_keymap_mod_get_index ( xkb_info - > keymap ,
" Mod5 " ) ;
xkb_info - > num_led = xkb_keymap_led_get_index ( xkb_info - > keymap ,
XKB_LED_NAME_NUM ) ;
xkb_info - > caps_led = xkb_keymap_led_get_index ( xkb_info - > keymap ,
XKB_LED_NAME_CAPS ) ;
xkb_info - > scroll_led = xkb_keymap_led_get_index ( xkb_info - > keymap ,
XKB_LED_NAME_SCROLL ) ;
keymap_str = xkb_keymap_get_as_string ( xkb_info - > keymap ,
XKB_KEYMAP_FORMAT_TEXT_V1 ) ;
if ( keymap_str = = NULL ) {
weston_log ( " failed to get string version of keymap \n " ) ;
goto err_keymap ;
@ -1965,7 +1969,7 @@ err_dev_zero:
err_keymap_str :
free ( keymap_str ) ;
err_keymap :
xkb_map_unref ( xkb_info - > keymap ) ;
xkb_key map_unref ( xkb_info - > keymap ) ;
free ( xkb_info ) ;
return NULL ;
}
@ -1978,9 +1982,9 @@ weston_compositor_build_global_keymap(struct weston_compositor *ec)
if ( ec - > xkb_info ! = NULL )
return 0 ;
keymap = xkb_map_new_from_names ( ec - > xkb_context ,
& ec - > xkb_names ,
0 ) ;
keymap = xkb_key map_new_from_names ( ec - > xkb_context ,
& ec - > xkb_names ,
0 ) ;
if ( keymap = = NULL ) {
weston_log ( " failed to compile global XKB keymap \n " ) ;
weston_log ( " tried rules %s, model %s, layout %s, variant %s, "