X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=radiant%2Fmain.cpp;h=6c8ffd037992e5173a564986264232adbd9f2562;hb=f100a82117cc13e8a646e39349865cd35d54b891;hp=ff141f6f529a436a3441584aa54ce9b5fc77d7c0;hpb=0b1f60f28f95e7ed12fea4ed1dc3e30588f2a2ed;p=xonotic%2Fnetradiant.git diff --git a/radiant/main.cpp b/radiant/main.cpp index ff141f6f..6c8ffd03 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -502,11 +502,23 @@ void user_shortcuts_save(){ SaveCommandMap( path.c_str() ); } +/* HACK: If ui::main is not called yet, +gtk_main_quit will not quit, so tell main +to not call ui::main. This happens when a +map is loaded from command line and require +a restart because of wrong format. +Delete this when the code to not have to +restart to load another format is merged. */ +bool g_dontStart = false; + int main( int argc, char* argv[] ){ #if GTK_TARGET == 3 // HACK: force legacy GL backend as we don't support GL3 yet setenv("GDK_GL", "LEGACY", 0); +#if GDEF_OS_LINUX || GDEF_OS_BSD + setenv("GDK_BACKEND", "x11", 0); #endif +#endif // GTK_TARGET == 3 crt_init(); streams_init(); @@ -633,7 +645,17 @@ int main( int argc, char* argv[] ){ remove_local_pid(); - ui::main(); + /* HACK: If ui::main is not called yet, + gtk_main_quit will not quit, so tell main + to not call ui::main. This happens when a + map is loaded from command line and require + a restart because of wrong format. + Delete this when the code to not have to + restart to load another format is merged. */ + if ( !g_dontStart ) + { + ui::main(); + } // avoid saving prefs when the app is minimized if ( g_pParentWnd->IsSleeping() ) {