Lines 1-6
Link Here
|
1 |
--- Telegram/SourceFiles/platform/linux/main_window_linux.cpp.orig 2019-09-06 13:41:43 UTC |
1 |
--- Telegram/SourceFiles/platform/linux/main_window_linux.cpp.orig 2019-09-27 17:04:25 UTC |
2 |
+++ Telegram/SourceFiles/platform/linux/main_window_linux.cpp |
2 |
+++ Telegram/SourceFiles/platform/linux/main_window_linux.cpp |
3 |
@@ -26,7 +26,9 @@ bool noQtTrayIcon = false, tryAppIndicator = false; |
3 |
@@ -28,7 +28,9 @@ bool noQtTrayIcon = false, tryAppIndicator = false; |
4 |
bool useGtkBase = false, useAppIndicator = false, useStatusIcon = false, trayIconChecked = false, useUnityCount = false; |
4 |
bool useGtkBase = false, useAppIndicator = false, useStatusIcon = false, trayIconChecked = false, useUnityCount = false; |
5 |
|
5 |
|
6 |
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION |
6 |
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION |
Lines 10-16
Link Here
|
10 |
GtkStatusIcon *_trayIcon = 0; |
10 |
GtkStatusIcon *_trayIcon = 0; |
11 |
GtkWidget *_trayMenu = 0; |
11 |
GtkWidget *_trayMenu = 0; |
12 |
GdkPixbuf *_trayPixbuf = 0; |
12 |
GdkPixbuf *_trayPixbuf = 0; |
13 |
@@ -292,7 +294,9 @@ void MainWindow::workmodeUpdated(DBIWorkMode mode) { |
13 |
@@ -294,7 +296,9 @@ void MainWindow::workmodeUpdated(DBIWorkMode mode) { |
14 |
if (noQtTrayIcon) { |
14 |
if (noQtTrayIcon) { |
15 |
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION |
15 |
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION |
16 |
if (useAppIndicator) { |
16 |
if (useAppIndicator) { |
Lines 20-26
Link Here
|
20 |
} else if (useStatusIcon) { |
20 |
} else if (useStatusIcon) { |
21 |
Libs::gtk_status_icon_set_visible(_trayIcon, false); |
21 |
Libs::gtk_status_icon_set_visible(_trayIcon, false); |
22 |
} |
22 |
} |
23 |
@@ -308,7 +312,9 @@ void MainWindow::workmodeUpdated(DBIWorkMode mode) { |
23 |
@@ -310,7 +314,9 @@ void MainWindow::workmodeUpdated(DBIWorkMode mode) { |
24 |
if (noQtTrayIcon) { |
24 |
if (noQtTrayIcon) { |
25 |
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION |
25 |
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION |
26 |
if (useAppIndicator) { |
26 |
if (useAppIndicator) { |
Lines 30-36
Link Here
|
30 |
} else if (useStatusIcon) { |
30 |
} else if (useStatusIcon) { |
31 |
Libs::gtk_status_icon_set_visible(_trayIcon, true); |
31 |
Libs::gtk_status_icon_set_visible(_trayIcon, true); |
32 |
} |
32 |
} |
33 |
@@ -327,7 +333,9 @@ void MainWindow::psUpdateIndicator() { |
33 |
@@ -329,7 +335,9 @@ void MainWindow::psUpdateIndicator() { |
34 |
if (iconFile.exists()) { |
34 |
if (iconFile.exists()) { |
35 |
QByteArray path = QFile::encodeName(iconFile.absoluteFilePath()), name = QFile::encodeName(iconFile.fileName()); |
35 |
QByteArray path = QFile::encodeName(iconFile.absoluteFilePath()), name = QFile::encodeName(iconFile.fileName()); |
36 |
name = name.mid(0, name.size() - 4); |
36 |
name = name.mid(0, name.size() - 4); |
Lines 40-46
Link Here
|
40 |
} else { |
40 |
} else { |
41 |
useAppIndicator = false; |
41 |
useAppIndicator = false; |
42 |
} |
42 |
} |
43 |
@@ -424,11 +432,15 @@ void MainWindow::LibsLoaded() { |
43 |
@@ -426,11 +434,15 @@ void MainWindow::LibsLoaded() { |
44 |
&& (Libs::g_object_ref_sink != nullptr) |
44 |
&& (Libs::g_object_ref_sink != nullptr) |
45 |
&& (Libs::g_object_unref != nullptr); |
45 |
&& (Libs::g_object_unref != nullptr); |
46 |
|
46 |
|
Lines 56-62
Link Here
|
56 |
|
56 |
|
57 |
if (tryAppIndicator && useGtkBase && useAppIndicator) { |
57 |
if (tryAppIndicator && useGtkBase && useAppIndicator) { |
58 |
noQtTrayIcon = true; |
58 |
noQtTrayIcon = true; |
59 |
@@ -464,6 +476,7 @@ void MainWindow::psCreateTrayIcon() { |
59 |
@@ -466,6 +478,7 @@ void MainWindow::psCreateTrayIcon() { |
60 |
} |
60 |
} |
61 |
|
61 |
|
62 |
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION |
62 |
#ifndef TDESKTOP_DISABLE_GTK_INTEGRATION |
Lines 64-70
Link Here
|
64 |
if (useAppIndicator) { |
64 |
if (useAppIndicator) { |
65 |
DEBUG_LOG(("Trying to create AppIndicator")); |
65 |
DEBUG_LOG(("Trying to create AppIndicator")); |
66 |
_trayMenu = Libs::gtk_menu_new(); |
66 |
_trayMenu = Libs::gtk_menu_new(); |
67 |
@@ -494,6 +507,7 @@ void MainWindow::psCreateTrayIcon() { |
67 |
@@ -496,6 +509,7 @@ void MainWindow::psCreateTrayIcon() { |
68 |
useAppIndicator = false; |
68 |
useAppIndicator = false; |
69 |
} |
69 |
} |
70 |
} |
70 |
} |
Lines 72-78
Link Here
|
72 |
if (useStatusIcon) { |
72 |
if (useStatusIcon) { |
73 |
if (Libs::gdk_init_check(0, 0)) { |
73 |
if (Libs::gdk_init_check(0, 0)) { |
74 |
if (!_trayMenu) _trayMenu = Libs::gtk_menu_new(); |
74 |
if (!_trayMenu) _trayMenu = Libs::gtk_menu_new(); |
75 |
@@ -628,10 +642,12 @@ MainWindow::~MainWindow() { |
75 |
@@ -630,10 +644,12 @@ MainWindow::~MainWindow() { |
76 |
Libs::g_object_unref(_trayMenu); |
76 |
Libs::g_object_unref(_trayMenu); |
77 |
_trayMenu = nullptr; |
77 |
_trayMenu = nullptr; |
78 |
} |
78 |
} |