From d460897f84bad314302df1198b3dbcf3f11bf653 Mon Sep 17 00:00:00 2001 From: Marco Trevisan Date: Tue, 22 Nov 2016 07:46:08 +0100 Subject: [PATCH] main-window-linux: parse XDG_CURRENT_DESKTOP as colon separated list (#2659) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As per freedesktop specifications¹, $XDG_CURRENT_DESKTOP is a "colon-separated list of strings". Thus we need to parse it in that way. [1] https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html Signed-off-by: Marco Trevisan (github: 3v1n0) --- Telegram/SourceFiles/platform/linux/main_window_linux.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp index 5d2c22f30..7f251d44d 100644 --- a/Telegram/SourceFiles/platform/linux/main_window_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/main_window_linux.cpp @@ -368,9 +368,9 @@ bool MainWindow::psHasNativeNotifications() { } void MainWindow::LibsLoaded() { - QString cdesktop = QString(getenv("XDG_CURRENT_DESKTOP")).toLower(); - noQtTrayIcon = (cdesktop == qstr("pantheon")) || (cdesktop == qstr("gnome")); - tryAppIndicator = (cdesktop == qstr("xfce")); + QStringList cdesktop = QString(getenv("XDG_CURRENT_DESKTOP")).toLower().split(':'); + noQtTrayIcon = (cdesktop.contains(qstr("pantheon"))) || (cdesktop.contains(qstr("gnome"))); + tryAppIndicator = cdesktop.contains(qstr("xfce")); if (noQtTrayIcon) cSetSupportTray(false);