From: RĂ©mi Denis-Courmont Date: Wed, 30 Dec 2009 20:42:42 +0000 (+0200) Subject: XCB global hotkeys: don't bother unregistering X-Git-Tag: 1.1.0-ff~1547 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=aa5891a4ee4c036b02519940ee183d04fcb81d3e;p=vlc XCB global hotkeys: don't bother unregistering We shut the X11 connection down immediately anyway. This will automatically undo all of our key grabs. --- diff --git a/modules/control/globalhotkeys/xcb.c b/modules/control/globalhotkeys/xcb.c index b47431af38..8fe4167f81 100644 --- a/modules/control/globalhotkeys/xcb.c +++ b/modules/control/globalhotkeys/xcb.c @@ -80,7 +80,6 @@ struct intf_sys_t static bool Mapping( intf_thread_t *p_intf ); static void Register( intf_thread_t *p_intf ); -static void Unregister( intf_thread_t *p_intf ); static void *Thread( void *p_data ); /***************************************************************************** @@ -135,7 +134,6 @@ static int Open( vlc_object_t *p_this ) if( vlc_clone( &p_sys->thread, Thread, p_intf, VLC_THREAD_PRIORITY_LOW ) ) { - Unregister( p_intf ); #ifndef XCB_KEYSYM_OLD_API /* as seen in Debian Lenny */ if( p_sys->p_map ) free( p_sys->p_map->p_keys ); @@ -167,7 +165,6 @@ static void Close( vlc_object_t *p_this ) vlc_cancel( p_sys->thread ); vlc_join( p_sys->thread, NULL ); - Unregister( p_intf ); #ifndef XCB_KEYSYM_OLD_API /* as seen in Debian Lenny */ if( p_sys->p_map ) free( p_sys->p_map->p_keys ); @@ -418,23 +415,6 @@ static void Register( intf_thread_t *p_intf ) #endif } } -static void Unregister( intf_thread_t *p_intf ) -{ - intf_sys_t *p_sys = p_intf->p_sys; - - for( int i = 0; i < p_sys->i_map; i++ ) - { - const hotkey_mapping_t *p_map = &p_sys->p_map[i]; -#ifdef XCB_KEYSYM_OLD_API /* as seen in Debian Lenny */ - xcb_ungrab_key( p_sys->p_connection, p_map->i_x11, p_sys->root, - p_map->i_modifier ); -#else - for( int j = 0; p_map->p_keys[j] != XCB_NO_SYMBOL; j++ ) - xcb_ungrab_key( p_sys->p_connection, p_map->p_keys[j], p_sys->root, - p_map->i_modifier ); -#endif - } -} static void *Thread( void *p_data ) {