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 <jhasse@bixense.com> (github: jhasse)
This commit is contained in:
Jan Niklas Hasse 2017-09-27 13:09:46 +02:00 committed by John Preston
parent 11a46a1072
commit e42cc02d0e
2 changed files with 5 additions and 1 deletions

View File

@ -20,6 +20,8 @@ Copyright (c) 2014-2017 John Preston, https://desktop.telegram.org
*/
#include "platform/linux/linux_desktop_environment.h"
#include <QDBusInterface>
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() {

View File

@ -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',