24#include <wx/filename.h>
37 if( wxGetEnv( wxT(
"XDG_CURRENT_DESKTOP" ), &wm ) && wm.CmpNoCase( wxT(
"Unity" ) ) == 0 )
38 wxSetEnv( wxT(
"UBUNTU_MENUPROXY" ), wxT(
"0" ) );
40 bool forceX11 =
false;
42#if wxCHECK_VERSION( 3, 3, 2 )
45 if( !wxGetEnv( wxT(
"WAYLAND_DISPLAY" ),
nullptr ) )
46 wxSystemOptions::SetOption(
"opengl.egl", 0 );
52 #if !wxUSE_GLCANVAS_EGL
59 wxSetEnv( wxT(
"GDK_BACKEND" ), wxT(
"x11" ) );
64 wxSetEnv( wxT(
"GDK_CORE_DEVICE_EVENTS" ), wxT(
"1" ) );
70 GError* err =
nullptr;
71 GFile* file = g_file_new_for_path( aPath.fn_str() );
73 bool retVal = g_file_trash( file,
nullptr, &err );
77 aError = err->message;
79 g_clear_error( &err );
80 g_object_unref( file );
95 wxString docsPath = g_get_user_data_dir();
97 if( docsPath.IsEmpty() )
101 fallback.AssignDir( g_get_home_dir() );
102 fallback.AppendDir( wxT(
".local" ) );
103 fallback.AppendDir( wxT(
"share" ) );
104 fallback.MakeAbsolute();
106 docsPath = fallback.GetFullPath();
115 return g_get_user_config_dir();
121 return g_get_user_data_dir();
127 return g_get_user_data_dir();
133 return g_get_user_cache_dir();
139 bool success =
false;
141 GProxyResolver*
resolver = g_proxy_resolver_get_default();
146 GError* error =
nullptr;
147 char** proxyList = g_proxy_resolver_lookup(
resolver, aURL.utf8_str(),
nullptr, &error );
151 g_error_free( error );
160 for(
int i = 0; proxyList[i] !=
nullptr; i++ )
162 wxString proxyUriStr( proxyList[i], wxConvUTF8 );
165 if( proxyUriStr == wxT(
"direct://" ) )
168 wxURI proxyUri( proxyUriStr );
177 wxString scheme = proxyUri.GetScheme();
179 if( !scheme.IsEmpty() )
180 aCfg.
host = scheme + wxT(
"://" );
182 wxString server = proxyUri.GetServer();
185 bool isIPv6 = server.Contains( wxT(
":" ) );
187 if( isIPv6 && proxyUri.HasPort() )
188 aCfg.
host += wxT(
"[" ) + server + wxT(
"]" );
192 if( proxyUri.HasPort() )
193 aCfg.
host += wxT(
":" ) + proxyUri.GetPort();
196 wxString userInfo = proxyUri.GetUserInfo();
198 if( !userInfo.IsEmpty() )
200 int colonPos = userInfo.Find( wxT(
":" ) );
202 if( colonPos != wxNOT_FOUND )
204 aCfg.
username = userInfo.Left( colonPos );
205 aCfg.
password = userInfo.Mid( colonPos + 1 );
217 g_strfreev( proxyList );
231 return wxEmptyString;
236 const wxString& aRelaunchDisplayName )
243 return wxEmptyString;
static FILENAME_RESOLVER * resolver