]> git.sesse.net Git - vlc/commitdiff
wx: Check in Open() if we have an X
authorChristophe Mutricy <xtophe@videolan.org>
Thu, 22 Mar 2007 17:37:57 +0000 (17:37 +0000)
committerChristophe Mutricy <xtophe@videolan.org>
Thu, 22 Mar 2007 17:37:57 +0000 (17:37 +0000)
modules/gui/wxwidgets/wxwidgets.cpp

index bdbf0489ad61d02e5814fb0ead8b6652216bb5d9..5529e78c1295bbcc2a36cb33e2a1def553a57799 100644 (file)
@@ -183,7 +183,14 @@ vlc_module_end();
 static int Open( vlc_object_t *p_this )
 {
     intf_thread_t *p_intf = (intf_thread_t *)p_this;
-
+    /* Test in we have an X*/
+#if defined HAVE_GETENV && (defined __WXGTK__ || defined __WXX11) 
+    if( !getenv( "DISPLAY" ) )
+    {
+        msg_Err( p_intf, "no X server");
+        return VLC_EGENERIC;
+    }
+#endif
     /* Allocate instance and initialize some members */
     p_intf->p_sys = (intf_sys_t *)malloc( sizeof( intf_sys_t ) );
     if( p_intf->p_sys == NULL )