From b8b21b943e0673fa36660b33b21749d5287f997b Mon Sep 17 00:00:00 2001 From: Ignacio Rodriguez Date: Wed, 2 Dec 2020 10:11:51 +0700 Subject: [PATCH] removing unnecessary check on icon tray --- ChangeLog | 1 + src/gui/src/main.cpp | 34 ---------------------------------- 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index a91fd115c..223801264 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ Bug fixes: - #6837 Memory leaks on macOS system - #6838 Enterprise asks for serial key on Linux system - #6846 TLS certificate is not created by default for Synergy Enterprise. +- #6??? Systray Icon on Ubuntu Auto Start Enhancements: - #6836 Enabling Github Code Scanning diff --git a/src/gui/src/main.cpp b/src/gui/src/main.cpp index b372390d5..336e11dab 100644 --- a/src/gui/src/main.cpp +++ b/src/gui/src/main.cpp @@ -16,9 +16,6 @@ * along with this program. If not, see . */ -#define TRAY_RETRY_COUNT 10 -#define TRAY_RETRY_WAIT 2000 - #include "QSynergyApplication.h" #include "LicenseManager.h" #include "MainWindow.h" @@ -46,7 +43,6 @@ public: } }; -int waitForTray(); QString getSystemSettingPath(); #if defined(Q_OS_MAC) @@ -80,11 +76,6 @@ int main(int argc, char* argv[]) } #endif - if (!waitForTray()) - { - return -1; - } - #ifndef Q_OS_WIN QApplication::setQuitOnLastWindowClosed(false); #endif @@ -120,31 +111,6 @@ int main(int argc, char* argv[]) return app.exec(); } -int waitForTray() -{ - // on linux, the system tray may not be available immediately after logging in, - // so keep retrying but give up after a short time. - int trayAttempts = 0; - while (true) - { - if (QSystemTrayIcon::isSystemTrayAvailable()) - { - break; - } - - if (++trayAttempts > TRAY_RETRY_COUNT) - { - QMessageBox::critical(NULL, "Synergy", - QObject::tr("System tray is unavailable, don't close your window.")); - return true; - } - - QThreadImpl::msleep(TRAY_RETRY_WAIT); - } - return true; -} - - #if defined(Q_OS_MAC) bool checkMacAssistiveDevices()