From 78638a3e2350955392498679cf0257b58b391aed Mon Sep 17 00:00:00 2001 From: trbogdanov <109601123+trbogdanov@users.noreply.github.com> Date: Mon, 31 Oct 2022 04:39:43 +0300 Subject: [PATCH] call gtk_init() before gtk_settings_get_default() to avoid Q_ASSERT triggering (#173) As stated in GTK documentation about gtk_init(): * "Call this function before using any other GTK+ functions in your GUI applications. It will initialize everything needed to operate the toolkit and parses some standard command line options." * "It is possible to pass NULL if argv is not available or commandline handling is not required." Fixes: #170 --- src/core/framelesshelpercore_global.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/framelesshelpercore_global.cpp b/src/core/framelesshelpercore_global.cpp index 9a8ee784..87e1bbc0 100644 --- a/src/core/framelesshelpercore_global.cpp +++ b/src/core/framelesshelpercore_global.cpp @@ -43,6 +43,9 @@ #endif #include #include +#ifdef Q_OS_LINUX +# include +#endif #ifndef COMPILER_STRING # ifdef Q_CC_CLANG // Must be before GNU, because Clang claims to be GNU too. @@ -111,6 +114,10 @@ void initialize() } inited = true; +#ifdef Q_OS_LINUX + gtk_init(nullptr, nullptr); +#endif + #ifdef Q_OS_LINUX // Qt's Wayland experience is not good, so we force the XCB backend here. // TODO: Remove this hack once Qt's Wayland implementation is good enough.