Loading libunity only in Unity and Pantheon. #3053

Commit 296c800b39 introduced a regression which caused crashes
in some ArchLinux distros when attempting to load or use libunity.
This commit is contained in:
John Preston
2017-02-26 20:19:35 +03:00
parent 5195b4d3ef
commit dcd6028e91
5 changed files with 204 additions and 8 deletions
@@ -23,6 +23,7 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
#include "styles/style_window.h"
#include "platform/linux/linux_libs.h"
#include "platform/linux/linux_desktop_environment.h"
#include "platform/platform_notifications_manager.h"
#include "mainwindow.h"
#include "application.h"
@@ -377,9 +378,9 @@ bool MainWindow::psHasNativeNotifications() {
}
void MainWindow::LibsLoaded() {
QStringList cdesktop = QString(getenv("XDG_CURRENT_DESKTOP")).toLower().split(':');
noQtTrayIcon = (cdesktop.contains(qstr("pantheon"))) || (cdesktop.contains(qstr("gnome")));
tryAppIndicator = (cdesktop.contains(qstr("xfce")) || cdesktop.contains(qstr("unity")));
auto cdesktop = Libs::CurrentDesktopStrings();
noQtTrayIcon = !DesktopEnvironment::TryQtTrayIcon();
tryAppIndicator = !DesktopEnvironment::PreferAppIndicatorTrayIcon();
if (noQtTrayIcon) cSetSupportTray(false);