The X11 connection and the poll()'ing thread are useless if we don't
grab any single key. We still return VLC_SUCCESS to avoid an error while
VLC is being started.
hotkey_mapping_t *p_map;
};
hotkey_mapping_t *p_map;
};
-static void Mapping( intf_thread_t *p_intf );
+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 );
static void Register( intf_thread_t *p_intf );
static void Unregister( intf_thread_t *p_intf );
static void *Thread( void *p_data );
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
intf_sys_t *p_sys;
{
intf_thread_t *p_intf = (intf_thread_t *)p_this;
intf_sys_t *p_sys;
+ int ret = VLC_EGENERIC;
p_intf->p_sys = p_sys = calloc( 1, sizeof(*p_sys) );
if( !p_sys )
p_intf->p_sys = p_sys = calloc( 1, sizeof(*p_sys) );
if( !p_sys )
if( !p_sys->p_symbols )
goto error;
if( !p_sys->p_symbols )
goto error;
+ if( !Mapping( p_intf ) )
+ {
+ ret = VLC_SUCCESS;
+ p_intf->p_sys = NULL; /* for Close() */
+ goto error;
+ }
Register( p_intf );
if( vlc_clone( &p_sys->thread, Thread, p_intf, VLC_THREAD_PRIORITY_LOW ) )
Register( p_intf );
if( vlc_clone( &p_sys->thread, Thread, p_intf, VLC_THREAD_PRIORITY_LOW ) )
xcb_key_symbols_free( p_sys->p_symbols );
xcb_disconnect( p_sys->p_connection );
free( p_sys );
xcb_key_symbols_free( p_sys->p_symbols );
xcb_disconnect( p_sys->p_connection );
free( p_sys );
}
/*****************************************************************************
}
/*****************************************************************************
intf_thread_t *p_intf = (intf_thread_t *)p_this;
intf_sys_t *p_sys = p_intf->p_sys;
intf_thread_t *p_intf = (intf_thread_t *)p_this;
intf_sys_t *p_sys = p_intf->p_sys;
+ if( !p_sys )
+ return; /* if we were running disabled */
+
vlc_cancel( p_sys->thread );
vlc_join( p_sys->thread, NULL );
vlc_cancel( p_sys->thread );
vlc_join( p_sys->thread, NULL );
-static void Mapping( intf_thread_t *p_intf )
+static bool Mapping( intf_thread_t *p_intf )
{
static const xcb_keysym_t p_x11_modifier_ignored[] = {
0,
{
static const xcb_keysym_t p_x11_modifier_ignored[] = {
0,
};
intf_sys_t *p_sys = p_intf->p_sys;
};
intf_sys_t *p_sys = p_intf->p_sys;
p_sys->i_map = 0;
p_sys->p_map = NULL;
p_sys->i_map = 0;
p_sys->p_map = NULL;
#endif
p_map->i_modifier = i_modifier|i_ignored;
p_map->i_action = i_vlc_action;
#endif
p_map->i_modifier = i_modifier|i_ignored;
p_map->i_action = i_vlc_action;
}
static void Register( intf_thread_t *p_intf )
}
static void Register( intf_thread_t *p_intf )