1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge pull request #3580

sudden6 (1):
      fix(systemtray): don't activate qTox widget on tray icon click in Unity backend
This commit is contained in:
Zetok Zalbavar 2016-08-08 11:07:47 +01:00
commit 59352ae797
No known key found for this signature in database
GPG Key ID: C953D3880212068A
4 changed files with 10 additions and 8 deletions

View File

@ -356,3 +356,8 @@ void SystemTrayIcon::setIcon(QIcon &icon)
qtIcon->setIcon(icon);
}
}
SystrayBackendType SystemTrayIcon::backend() const
{
return backendType;
}

View File

@ -38,6 +38,7 @@ public:
void hide();
void setVisible(bool);
void setIcon(QIcon &icon);
SystrayBackendType backend() const;
signals:
void activated(QSystemTrayIcon::ActivationReason);

View File

@ -63,15 +63,9 @@ extern "C" {
enum class SystrayBackendType
{
Qt,
#ifdef ENABLE_SYSTRAY_UNITY_BACKEND
Unity,
#endif
#ifdef ENABLE_SYSTRAY_STATUSNOTIFIER_BACKEND
StatusNotifier,
#endif
#ifdef ENABLE_SYSTRAY_GTK_BACKEND
GTK,
#endif
GTK
};
#endif // SYSTEMTRAYICON_PRIVATE_H

View File

@ -1815,7 +1815,9 @@ void Widget::onTryCreateTrayIcon()
trayMenu->addAction(actionQuit);
icon->setContextMenu(trayMenu);
connect(icon, &SystemTrayIcon::activated, this, &Widget::onIconClick);
// don't activate qTox widget on tray icon click in Unity backend (see #3419)
if (icon->backend() != SystrayBackendType::Unity)
connect(icon, &SystemTrayIcon::activated, this, &Widget::onIconClick);
if (Settings::getInstance().getShowSystemTray())
{