Commit ba423412 authored by Rafaël Carré's avatar Rafaël Carré

globalhotkeys xcb : fix modifiers with xcb-keysyms >= 0.3.4

parent 0ee1c43f
......@@ -182,6 +182,9 @@ static unsigned GetModifier( xcb_connection_t *p_connection, xcb_key_symbols_t *
XCB_MOD_MASK_4, XCB_MOD_MASK_5
};
if( sym == 0 )
return 0; /* no modifier */
#ifdef XCB_KEYSYM_OLD_API /* as seen in Debian Lenny */
const xcb_keycode_t key = xcb_key_symbols_get_keycode( p_symbols, sym );
if( key == 0 )
......@@ -190,6 +193,21 @@ static unsigned GetModifier( xcb_connection_t *p_connection, xcb_key_symbols_t *
const xcb_keycode_t *p_keys = xcb_key_symbols_get_keycode( p_symbols, sym );
if( !p_keys )
return 0;
int i = 0;
bool no_modifier = true;
while( p_keys[i] != XCB_NO_SYMBOL )
{
if( p_keys[i] != 0 )
{
no_modifier = false;
break;
}
i++;
}
if( no_modifier )
return 0;
#endif
xcb_get_modifier_mapping_cookie_t r =
......@@ -344,7 +362,7 @@ static void Mapping( intf_thread_t *p_intf )
{
const unsigned i_ignored = GetModifier( p_sys->p_connection,
p_sys->p_symbols, p_x11_modifier_ignored[i] );
if( i != 0 && i_ignored == 0x00)
if( i != 0 && i_ignored == 0)
continue;
hotkey_mapping_t *p_map_old = p_sys->p_map;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment