summarylogtreecommitdiffstats
path: root/Fix-desktop-integration-issues.patch
blob: 374c581a77f20d2cca1d6eed64e75f516192f954 (plain)
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
40
41
42
Description: Fix some problems with desktop integration which relate to names of the binaries
Author: Nicholas Guriev <guriev-ns@ya.ru>
Last-Update: 2017-01-26

diff --git a/Telegram/SourceFiles/pspecific_linux.cpp b/Telegram/SourceFiles/pspecific_linux.cpp
index 8b21afe..258b5bd 100644
--- a/Telegram/SourceFiles/pspecific_linux.cpp
+++ b/Telegram/SourceFiles/pspecific_linux.cpp
@@ -505,7 +505,7 @@ void psRegisterCustomScheme() {
 			s << "Exec=" << escapeShell(QFile::encodeName(cExeDir() + cExeName())) << " -- %u\n";
 			s << "Icon=telegram\n";
 			s << "Terminal=false\n";
-			s << "StartupWMClass=Telegram\n";
+			s << "StartupWMClass=TelegramDesktop\n";
 			s << "Type=Application\n";
 			s << "Categories=Network;\n";
 			s << "MimeType=x-scheme-handler/tg;\n";
@@ -572,7 +572,7 @@ bool _execUpdater(bool update = true, const QString &crashreport = QString()) {
 	static const int MaxLen = 65536, MaxArgsCount = 128;
 
 	char path[MaxLen] = {0};
-	QByteArray data(QFile::encodeName(cExeDir() + "Updater"));
+	QByteArray data(QFile::encodeName(cExeDir() + (update ? "Updater" : gExeName)));
 	memcpy(path, data.constData(), data.size());
 
 	char *args[MaxArgsCount] = {0}, p_noupdate[] = "-noupdate", p_autostart[] = "-autostart", p_debug[] = "-debug", p_tosettings[] = "-tosettings", p_key[] = "-key", p_path[] = "-workpath", p_startintray[] = "-startintray", p_testmode[] = "-testmode", p_crashreport[] = "-crashreport";
diff --git a/lib/xdg/telegramdesktop.desktop b/lib/xdg/telegramdesktop.desktop
index 35a5c61..da7a35a 100644
--- a/lib/xdg/telegramdesktop.desktop
+++ b/lib/xdg/telegramdesktop.desktop
@@ -4,9 +4,9 @@ Version=1.0
 Name=Telegram Desktop
 Comment=Official desktop version of Telegram messaging app
 Exec=/usr/bin/telegram-desktop -- %u
-Icon=telegram-desktop
+Icon=telegram
 Terminal=false
-StartupWMClass=Telegram
+StartupWMClass=TelegramDesktop
 Type=Application
 Categories=Network;
 MimeType=x-scheme-handler/tg;