From e42cc02d0eab067263b841133dbbee8674a667d0 Mon Sep 17 00:00:00 2001 From: Jan Niklas Hasse Date: Wed, 27 Sep 2017 13:09:46 +0200 Subject: [PATCH] Prefer AppIndicator if DBus interface is available Starting with Ubuntu 17.10 the interface will be provided by an extension (shipped by default): https://github.com/ubuntu/gnome-shell-extension-appindicator Legacy tray icons have been completely removed in GNOME 3.26. By checking the interface, this will allow users of other distributions with GNOME to also use Telegram's indicator with the extension. Signed-off-by: Jan Niklas Hasse (github: jhasse) --- .../SourceFiles/platform/linux/linux_desktop_environment.cpp | 5 ++++- Telegram/gyp/qt.gypi | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/platform/linux/linux_desktop_environment.cpp b/Telegram/SourceFiles/platform/linux/linux_desktop_environment.cpp index 158e6834c..16879097c 100644 --- a/Telegram/SourceFiles/platform/linux/linux_desktop_environment.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_desktop_environment.cpp @@ -20,6 +20,8 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org */ #include "platform/linux/linux_desktop_environment.h" +#include + namespace Platform { namespace DesktopEnvironment { namespace { @@ -120,7 +122,8 @@ bool TryQtTrayIcon() { } bool PreferAppIndicatorTrayIcon() { - return IsXFCE() || IsUnity(); + return IsXFCE() || IsUnity() || + (IsGnome() && QDBusInterface("org.kde.StatusNotifierWatcher", "/").isValid()); } bool TryUnityCounter() { diff --git a/Telegram/gyp/qt.gypi b/Telegram/gyp/qt.gypi index a292c9676..67f7976e2 100644 --- a/Telegram/gyp/qt.gypi +++ b/Telegram/gyp/qt.gypi @@ -196,6 +196,7 @@ '<(qt_loc)/include', '<(qt_loc)/include/QtCore', '<(qt_loc)/include/QtGui', + '<(qt_loc)/include/QtDBus', '<(qt_loc)/include/QtCore/<(qt_version)', '<(qt_loc)/include/QtGui/<(qt_version)', '<(qt_loc)/include/QtCore/<(qt_version)/QtCore',