diff --git a/src/gui/src/main.cpp b/src/gui/src/main.cpp index 76a7d1a2..b00ab7f1 100644 --- a/src/gui/src/main.cpp +++ b/src/gui/src/main.cpp @@ -88,16 +88,20 @@ int main(int argc, char* argv[]) } #endif - if (!waitForTray()) - { - return -1; - } + int trayAvailable = waitForTray(); QApplication::setQuitOnLastWindowClosed(false); QSettings settings; AppConfig appConfig (&settings); + if (appConfig.getAutoHide() && !trayAvailable) + { + // force auto hide to false - otherwise there is no way to get the GUI back + fprintf(stdout, "System tray not available, force disabling auto hide!\n"); + appConfig.setAutoHide(false); + } + app.switchTranslator(appConfig.language()); MainWindow mainWindow(settings, appConfig); @@ -131,7 +135,7 @@ int waitForTray() { QMessageBox::critical(NULL, "Barrier", QObject::tr("System tray is unavailable, don't close your window.")); - return true; + return false; } QThreadImpl::msleep(TRAY_RETRY_WAIT);