Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
call gtk_init() before gtk_settings_get_default() to avoid Q_ASSERT t…
Browse files Browse the repository at this point in the history
…riggering (#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
  • Loading branch information
trbogdanov authored Oct 31, 2022
1 parent 4c88bc5 commit 78638a3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/framelesshelpercore_global.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
#endif
#include <QtCore/qmutex.h>
#include <QtGui/qguiapplication.h>
#ifdef Q_OS_LINUX
# include <gtk/gtk.h>
#endif

#ifndef COMPILER_STRING
# ifdef Q_CC_CLANG // Must be before GNU, because Clang claims to be GNU too.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 78638a3

Please sign in to comment.