removing unnecessary check on icon tray

This commit is contained in:
Ignacio Rodriguez 2020-12-02 10:11:51 +07:00
parent 9d84f8e897
commit b8b21b943e
2 changed files with 1 additions and 34 deletions

View file

@ -5,6 +5,7 @@ Bug fixes:
- #6837 Memory leaks on macOS system - #6837 Memory leaks on macOS system
- #6838 Enterprise asks for serial key on Linux system - #6838 Enterprise asks for serial key on Linux system
- #6846 TLS certificate is not created by default for Synergy Enterprise. - #6846 TLS certificate is not created by default for Synergy Enterprise.
- #6??? Systray Icon on Ubuntu Auto Start
Enhancements: Enhancements:
- #6836 Enabling Github Code Scanning - #6836 Enabling Github Code Scanning

View file

@ -16,9 +16,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#define TRAY_RETRY_COUNT 10
#define TRAY_RETRY_WAIT 2000
#include "QSynergyApplication.h" #include "QSynergyApplication.h"
#include "LicenseManager.h" #include "LicenseManager.h"
#include "MainWindow.h" #include "MainWindow.h"
@ -46,7 +43,6 @@ public:
} }
}; };
int waitForTray();
QString getSystemSettingPath(); QString getSystemSettingPath();
#if defined(Q_OS_MAC) #if defined(Q_OS_MAC)
@ -80,11 +76,6 @@ int main(int argc, char* argv[])
} }
#endif #endif
if (!waitForTray())
{
return -1;
}
#ifndef Q_OS_WIN #ifndef Q_OS_WIN
QApplication::setQuitOnLastWindowClosed(false); QApplication::setQuitOnLastWindowClosed(false);
#endif #endif
@ -120,31 +111,6 @@ int main(int argc, char* argv[])
return app.exec(); 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) #if defined(Q_OS_MAC)
bool checkMacAssistiveDevices() bool checkMacAssistiveDevices()