diff --git a/src/platform_unix.cc b/src/platform_unix.cc index f84f8618..1154a2b4 100644 --- a/src/platform_unix.cc +++ b/src/platform_unix.cc @@ -112,9 +112,6 @@ platform_monitor_refresh_hz() int main(int argc, char** argv) { -#ifdef __linux__ - gtk_init(&argc, &argv); -#endif char* file_to_open = NULL; if ( argc == 2 ) { file_to_open = argv[1]; diff --git a/src/sdl_milton.cc b/src/sdl_milton.cc index 21efb800..2530e345 100644 --- a/src/sdl_milton.cc +++ b/src/sdl_milton.cc @@ -509,6 +509,7 @@ sdl_event_loop(MiltonState* milton_state, PlatformState* platform_state) int milton_main(char* file_to_open) { + #if defined(_WIN32) if (!SetProcessDPIAware()) // This function is only present in Windows versions higher than Vista. { @@ -525,6 +526,10 @@ milton_main(char* file_to_open) SDL_Init(SDL_INIT_VIDEO); milton_log("Done.\n"); + #ifdef __linux__ + gtk_init(NULL, NULL); + #endif + PlatformState platform_state = {}; PlatformPrefs prefs = {}; @@ -1059,5 +1064,3 @@ milton_main(char* file_to_open) return 0; } - -