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 );
{
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 )
if( !p_sys->p_symbols )
goto error;
- Mapping( p_intf );
+ 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 ) )
xcb_key_symbols_free( p_sys->p_symbols );
xcb_disconnect( p_sys->p_connection );
free( p_sys );
- return VLC_EGENERIC;
+ return ret;
}
/*****************************************************************************
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 );
return XK_VoidSymbol;
}
-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,
};
intf_sys_t *p_sys = p_intf->p_sys;
+ bool active = false;
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;
+ active = true;
}
}
+ return active;
}
static void Register( intf_thread_t *p_intf )