forked from flathub/org.telegram.desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
telegram-gnome-appindicator.patch
39 lines (31 loc) · 1.44 KB
/
telegram-gnome-appindicator.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From e42cc02d0eab067263b841133dbbee8674a667d0 Mon Sep 17 00:00:00 2001
From: Jan Niklas Hasse <jhasse@bixense.com>
Date: Wed, 27 Sep 2017 13:09:46 +0200
Subject: 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)
diff --git a/Telegram/SourceFiles/platform/linux/linux_desktop_environment.cpp b/Telegram/SourceFiles/platform/linux/linux_desktop_environment.cpp
index 158e6834..16879097 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 <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() {