Permalink
Browse files

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)
  • Loading branch information...
1 parent 11a46a1 commit e42cc02d0eab067263b841133dbbee8674a667d0 @jhasse jhasse committed with john-preston Sep 27, 2017
Showing with 5 additions and 1 deletion.
  1. +4 −1 Telegram/SourceFiles/platform/linux/linux_desktop_environment.cpp
  2. +1 −0 Telegram/gyp/qt.gypi
@@ -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
@@ -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',

0 comments on commit e42cc02

Please sign in to comment.