/*****************************************************************************
* Module descriptor
*****************************************************************************/
-vlc_module_begin();
- set_shortname( _("Global Hotkeys") );
- set_category( CAT_INTERFACE );
- set_subcategory( SUBCAT_INTERFACE_HOTKEYS );
- set_description( _("Global Hotkeys interface") );
- set_capability( "interface", 0 );
- set_callbacks( Open, Close );
-vlc_module_end();
+vlc_module_begin()
+ set_shortname( N_("Global Hotkeys") )
+ set_category( CAT_INTERFACE )
+ set_subcategory( SUBCAT_INTERFACE_HOTKEYS )
+ set_description( N_("Global Hotkeys interface") )
+ set_capability( "interface", 0 )
+ set_callbacks( Open, Close )
+vlc_module_end()
typedef struct
{
static void Register( intf_thread_t *p_intf );
static void Unregister( intf_thread_t *p_intf );
static void *Thread( void *p_data );
+static int X11ErrorHandler( Display *, XErrorEvent * );
/*****************************************************************************
* Open:
Display *p_display = XOpenDisplay( NULL );
if( !p_display )
return VLC_EGENERIC;
+ XSetErrorHandler( X11ErrorHandler );
p_intf->p_sys = p_sys = malloc( sizeof(*p_sys) );
if( !p_sys )
}
/*****************************************************************************
- * Thread:
+ *
*****************************************************************************/
+static int X11ErrorHandler( Display *p_display, XErrorEvent *p_event )
+{
+#if 0
+ char psz_txt[1024];
+
+ XGetErrorText( p_display, p_event->error_code, psz_txt, sizeof(psz_txt) );
+ fprintf( stderr,
+ "[????????] globalhotkeys interface error: X11 request %u.%u failed "
+ "with error code %u:\n %s\n",
+ p_event->request_code, p_event->minor_code, p_event->error_code, psz_txt );
+#else
+ VLC_UNUSED(p_display); VLC_UNUSED(p_event);
+#endif
+ /* Ignore them */
+ return 0;
+}
static unsigned GetModifier( Display *p_display, KeySym sym )
{
static const unsigned pi_mask[8] = {
{
if( errno != EINTR )
break;
+ canc = vlc_savecancel();
continue;
}
canc = vlc_savecancel();
}
}
- vlc_restorecancel( canc );
return NULL;
}