2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-01 23:15:59 +00:00

fixed Qt tray icon for KDE, using Qt tray icon for all graphic envs, testing

This commit is contained in:
John Preston
2015-07-21 15:29:38 +02:00
parent c553ed6775
commit f0f0be9452
2 changed files with 19 additions and 13 deletions

View File

@@ -68,7 +68,7 @@ namespace {
bool frameless = true;
bool finished = true;
bool noQtTrayIcon = false;
bool noQtTrayIcon = false, noTryUnity = false;
bool useGtkBase = false, useAppIndicator = false, useStatusIcon = false, trayIconChecked = false, useUnityCount = false;
AppIndicator *_trayIndicator = 0;
@@ -351,10 +351,16 @@ namespace {
class _PsInitializer {
public:
_PsInitializer() {
static bool inited = false;
if (inited) return;
inited = true;
QString cdesktop = QString(getenv("XDG_CURRENT_DESKTOP")).toLower();
noQtTrayIcon = (cdesktop == qstr("unity")) || (cdesktop == qstr("pantheon")) || (cdesktop == qstr("gnome"));
noQtTrayIcon = false;//(cdesktop == qstr("pantheon")) || (cdesktop == qstr("gnome"));
noTryUnity = (cdesktop != qstr("unity"));
if (noQtTrayIcon) cSetSupportTray(false);
std::cout << "libs init..\n";
setupGtk();
setupUnity();
@@ -458,9 +464,9 @@ namespace {
}
void setupUnity() {
if (!useGtkBase || !noQtTrayIcon) return;
if (noTryUnity) return;
QLibrary lib_unity(qstr("unity"), 9, 0);
QLibrary lib_unity(qstr("unity"), 9, 0);
if (!loadLibrary(lib_unity, "unity", 9)) return;
if (!loadFunction(lib_unity, "unity_launcher_entry_get_for_desktop_id", ps_unity_launcher_entry_get_for_desktop_id)) return;
@@ -470,7 +476,6 @@ namespace {
std::cout << "unity count api loaded\n";
}
};
_PsInitializer _psInitializer;
class _PsEventFilter : public QAbstractNativeEventFilter {
public:
@@ -933,6 +938,8 @@ void PsMainWindow::psPlatformNotify(HistoryItem *item, int32 fwdCount) {
}
PsApplication::PsApplication(int &argc, char **argv) : QApplication(argc, argv) {
_PsInitializer _psInitializer;
Q_UNUSED(_psInitializer);
}
void PsApplication::psInstallEventFilter() {