2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-01 07:05:13 +00:00

Building Qt with -no-gtkstyle and disable forcing "-style=0" in main.cpp

We can't use Qt gtk style, because it loads gtk-2 and we are possibly
loading and using gtk-3 for libappindicator3 and it crashes :(
This commit is contained in:
John Preston
2016-07-07 19:12:52 +03:00
parent 5f46541f0b
commit a20dd065fb
8 changed files with 57 additions and 41 deletions

View File

@@ -44,21 +44,9 @@ int main(int argc, char *argv[]) {
Logs::start(); // must be started before Platform is started
Platform::start(); // must be started before QApplication is created
// 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(a_argc, a_argv);
Application app(argc, argv);
result = app.exec();
}