Kaydet (Commit) 6163c62a authored tarafından Luboš Luňák's avatar Luboš Luňák

let Qt call XInitThreads(), so that it knows it's been called (fdo#40298)

Otherwise QPixmap complains when used outside of the main Qt thread
and resets itself to null pixmap, eventually leading to crashes.
üst bce48fb9
...@@ -56,7 +56,18 @@ extern "C" { ...@@ -56,7 +56,18 @@ extern "C" {
established, so protect X against itself established, so protect X against itself
*/ */
if( ! ( pNoXInitThreads && *pNoXInitThreads ) ) if( ! ( pNoXInitThreads && *pNoXInitThreads ) )
{
#if QT_VERSION >= 0x040800
// let Qt call XInitThreads(), so that also Qt knows it's been used
// (otherwise QPixmap may warn about threads not being initialized)
QApplication::setAttribute( Qt::AA_X11InitThreads );
#else
XInitThreads(); XInitThreads();
// just in case somebody builds with old version and then upgrades Qt,
// otherwise this is a no-op
QApplication::setAttribute( static_cast< ApplicationAttribute >( 10 ));
#endif
}
#if QT_VERSION < 0x050000 #if QT_VERSION < 0x050000
// Qt 4.x support needs >= 4.1.0 // Qt 4.x support needs >= 4.1.0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment