[libreoffice/f15] Resolves: rhbz#747356 let Qt call XInitThreads

Caolan McNamara caolanm at fedoraproject.org
Fri Oct 21 12:12:53 UTC 2011


commit 232ea67a5c129931963842eda99820168aea9b29
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 21 13:12:50 2011 +0100

    Resolves: rhbz#747356 let Qt call XInitThreads

 ...-XInitThreads-so-that-it-knows-it-s-been-.patch |   38 ++++++++++++++++++++
 libreoffice.spec                                   |    7 +++-
 2 files changed, 44 insertions(+), 1 deletions(-)
---
diff --git a/0001-let-Qt-call-XInitThreads-so-that-it-knows-it-s-been-.patch b/0001-let-Qt-call-XInitThreads-so-that-it-knows-it-s-been-.patch
new file mode 100644
index 0000000..f7f0229
--- /dev/null
+++ b/0001-let-Qt-call-XInitThreads-so-that-it-knows-it-s-been-.patch
@@ -0,0 +1,38 @@
+From 6163c62a52794725188faf82ee12852f4b2cd023 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= <l.lunak at suse.cz>
+Date: Thu, 20 Oct 2011 16:41:50 +0200
+Subject: [PATCH] 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.
+---
+ vcl/unx/kde4/main.cxx |   11 +++++++++++
+ 1 files changed, 11 insertions(+), 0 deletions(-)
+
+diff --git a/vcl/unx/kde4/main.cxx b/vcl/unx/kde4/main.cxx
+index 9e0a361..482a212 100644
+--- a/vcl/unx/kde4/main.cxx
++++ b/vcl/unx/kde4/main.cxx
+@@ -56,7 +56,18 @@ extern "C" {
+            established, so protect X against itself
+         */
+         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();
++            // 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
+         // Qt 4.x support needs >= 4.1.0
+-- 
+1.7.6.4
+
diff --git a/libreoffice.spec b/libreoffice.spec
index 2a04c4c..294aaa7 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -29,7 +29,7 @@ Summary:        Free Software Productivity Suite
 Name:           libreoffice
 Epoch:          1
 Version:        3.3.3.1
-Release:        7%{?dist}
+Release:        8%{?dist}
 License:        LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and (CDDL or GPLv2) and Public Domain
 Group:          Applications/Productivity
 URL:            http://www.documentfoundation.org/develop
@@ -162,6 +162,7 @@ Patch73: 0001-Resolves-rhbz-738255-avoid-crash-on-NULL-pointer.patch
 Patch74: 0001-On-recovery-from-an-autosave-file-use-DefaultFilter-.patch
 Patch75: 0001-Fix-for-fdo-35513-avoid-crash-while-processing-incor.patch
 Patch76: 2011-2713.patch
+Patch77: 0001-let-Qt-call-XInitThreads-so-that-it-knows-it-s-been-.patch
 
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
 %define instdir %{_libdir}
@@ -843,6 +844,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc
 %patch74 -p1 -b .On-recovery-from-an-autosave-file-use-DefaultFilter-.patch
 %patch75 -p1 -b .fdo-35513-avoid-crash-while-processing-incor.patch
 %patch76 -p1 -b .2011-2713.patch
+%patch77 -p1 -b .let-Qt-call-XInitThreads-so-that-it-knows-it-s-been-.patch
 
 touch scripting/source/pyprov/delzip
 touch scripting/util/provider/beanshell/delzip
@@ -2187,6 +2189,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
 %{basisinstdir}/program/kde-open-url
 
 %changelog
+* Fri Oct 21 2011 Caolán McNamara <caolanm at redhat.com> 1:3.3.3.1-8-UNBUILT
+- Resolves: rhbz#747356 let Qt call XInitThreads
+
 * Wed Oct 05 2011 Caolán McNamara <caolanm at redhat.com> 1:3.3.3.1-7
 - Resolves: CVE-2011-2713, binary .doc parsing fixes
 - Resolves: rhbz#739407 recovery from autosave for non odf format


More information about the scm-commits mailing list