From c6437ce8935f66494ab8537ce10313b3f0858b45 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 15 Mar 2016 21:29:20 +0300 Subject: [PATCH] returned the fake -style=0 arg for QApplication, currently it must not load gtk library itself, see https://github.com/telegramdesktop/tdesktop/issues/1774 --- Telegram/SourceFiles/main.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/main.cpp b/Telegram/SourceFiles/main.cpp index 571ef6f72a..b79c0f7adb 100644 --- a/Telegram/SourceFiles/main.cpp +++ b/Telegram/SourceFiles/main.cpp @@ -38,14 +38,21 @@ int main(int argc, char *argv[]) { Logs::start(); // must be started before PlatformSpecific is started PlatformSpecific::start(); // must be started before QApplication is created - //QByteArray args[] = { "-style=0" }; // prepare fake args to disable QT_STYLE_OVERRIDE env variable - //static const int a_cnt = sizeof(args) / sizeof(args[0]); - //int a_argc = a_cnt + 1; - //char *a_argv[a_cnt + 1] = { argv[0], args[0].data() }; + // prepare fake args to disable QT_STYLE_OVERRIDE env variable + // currently this is required in some desktop environments, including Xubuntu 15.10 + // when we don't default style to "none" Qt dynamically loads GTK somehow internally and + // our own GTK dynamic load and usage leads GTK errors and freeze of the current main thread + // we can't disable our own GTK loading because it is required by libappindicator, which + // provides the tray icon for this system, because Qt tray icon is broken there + // see https://github.com/telegramdesktop/tdesktop/issues/1774 + QByteArray args[] = { "-style=0" }; + static const int a_cnt = sizeof(args) / sizeof(args[0]); + int a_argc = a_cnt + 1; + char *a_argv[a_cnt + 1] = { argv[0], args[0].data() }; int result = 0; { - Application app(argc, argv); + Application app(a_argc, a_argv); result = app.exec(); }