[vlc-devel] commit: XCB global hotkeys: don't bother unregistering ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Dec 30 21:43:54 CET 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec 30 22:42:42 2009 +0200| [aa5891a4ee4c036b02519940ee183d04fcb81d3e] | committer: Rémi Denis-Courmont 

XCB global hotkeys: don't bother unregistering

We shut the X11 connection down immediately anyway. This will
automatically undo all of our key grabs.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aa5891a4ee4c036b02519940ee183d04fcb81d3e
---

 modules/control/globalhotkeys/xcb.c |   20 --------------------
 1 files changed, 0 insertions(+), 20 deletions(-)

diff --git a/modules/control/globalhotkeys/xcb.c b/modules/control/globalhotkeys/xcb.c
index b47431a..8fe4167 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 )
 {




More information about the vlc-devel mailing list