diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp index 10741e77b9..1202e06fb0 100644 --- a/src/gtk/settings.cpp +++ b/src/gtk/settings.cpp @@ -13,6 +13,7 @@ #include "wx/settings.h" #ifndef WX_PRECOMP + #include "wx/app.h" #include "wx/toplevel.h" #include "wx/module.h" #endif @@ -1206,6 +1207,10 @@ bool wxSystemSettingsModule::OnInit() m_proxy = nullptr; + wxAppConsole* app = wxAppConsole::GetInstance(); + if (!app || !app->IsGUI()) + return true; + // GTK_THEME environment variable overrides other settings if (getenv("GTK_THEME") == nullptr) {