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

Disable systray icon on KDE 5

Hopefully fixes #1116
This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2015-02-07 19:40:49 +01:00
parent 94e30b9e2d
commit 39170de667
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
2 changed files with 10 additions and 3 deletions

View File

@ -34,6 +34,12 @@ SystemTrayIcon::SystemTrayIcon()
app_indicator_set_menu(unityIndicator, GTK_MENU(unityMenu));
}
#endif
else if (desktop.toLower() == "kde"
&& getenv("KDE_SESSION_VERSION") == QString("5"))
{
backendType = SystrayBackendType::KDE5;
qWarning() << "SystemTrayIcon: Detected a KDE5 session, disabling the icon";
}
else
{
qtIcon = new QSystemTrayIcon;
@ -104,7 +110,7 @@ void SystemTrayIcon::setContextMenu(QMenu* menu)
g_signal_connect(rootMenuItem, "about-to-show", G_CALLBACK(callback), this);
}
#endif
else
else if (backendType == SystrayBackendType::Qt)
{
qtIcon->setContextMenu(menu);
}
@ -132,7 +138,7 @@ void SystemTrayIcon::setVisible(bool newState)
app_indicator_set_status(unityIndicator, APP_INDICATOR_STATUS_PASSIVE);
}
#endif
else
else if (backendType == SystrayBackendType::Qt)
{
if (newState)
qtIcon->show();
@ -160,7 +166,7 @@ void SystemTrayIcon::setIcon(QIcon &&icon)
}
}
#endif
else
else if (backendType == SystrayBackendType::Qt)
{
qtIcon->setIcon(icon);
}

View File

@ -18,6 +18,7 @@ extern "C" {
enum class SystrayBackendType
{
Qt,
KDE5,
#ifdef ENABLE_SYSTRAY_UNITY_BACKEND
Unity
#endif