From 5765209fe814fccbb1c99fc159b96708f5b29e6f Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 6 Jan 2024 05:31:09 +0100 Subject: [PATCH] apply patches needed by libreoffice [release 4.8.6-3mamba;Sat Sep 20 2014] --- ...ib-honor-ExcludeSocketNotifiers-flag.patch | 63 +++++++++++++ libqt4-4.8.6-qclipboard_delay.patch | 12 +++ libqt4-4.8.6-qclipboard_fix_recursive.patch | 94 +++++++++++++++++++ libqt4.spec | 13 ++- 4 files changed, 180 insertions(+), 2 deletions(-) create mode 100644 libqt4-4.8.6-glib-honor-ExcludeSocketNotifiers-flag.patch create mode 100644 libqt4-4.8.6-qclipboard_delay.patch create mode 100644 libqt4-4.8.6-qclipboard_fix_recursive.patch diff --git a/libqt4-4.8.6-glib-honor-ExcludeSocketNotifiers-flag.patch b/libqt4-4.8.6-glib-honor-ExcludeSocketNotifiers-flag.patch new file mode 100644 index 0000000..6949bbf --- /dev/null +++ b/libqt4-4.8.6-glib-honor-ExcludeSocketNotifiers-flag.patch @@ -0,0 +1,63 @@ +Author: Jan-Marek Glogowski +Date: Thu Mar 06 18:44:43 2014 +0100 + + Honor QEventLoop::ExcludeSocketNotifiers in glib event loop. + + Implements QEventLoop::ExcludeSocketNotifiers in the same way + QEventLoop::X11ExcludeTimers is already implemented for the glib + event loop. + +--- qt4-x11-4.8.1.orig/src/corelib/kernel/qeventdispatcher_glib.cpp ++++ qt4-x11-4.8.1/src/corelib/kernel/qeventdispatcher_glib.cpp +@@ -65,6 +65,7 @@ struct GPollFDWithQSocketNotifier + struct GSocketNotifierSource + { + GSource source; ++ QEventLoop::ProcessEventsFlags processEventsFlags; + QList pollfds; + }; + +@@ -80,6 +81,9 @@ static gboolean socketNotifierSourceChec + GSocketNotifierSource *src = reinterpret_cast(source); + + bool pending = false; ++ if (src->processEventsFlags & QEventLoop::ExcludeSocketNotifiers) ++ return pending; ++ + for (int i = 0; !pending && i < src->pollfds.count(); ++i) { + GPollFDWithQSocketNotifier *p = src->pollfds.at(i); + +@@ -103,6 +107,9 @@ static gboolean socketNotifierSourceDisp + QEvent event(QEvent::SockAct); + + GSocketNotifierSource *src = reinterpret_cast(source); ++ if (src->processEventsFlags & QEventLoop::ExcludeSocketNotifiers) ++ return true; ++ + for (int i = 0; i < src->pollfds.count(); ++i) { + GPollFDWithQSocketNotifier *p = src->pollfds.at(i); + +@@ -330,6 +337,7 @@ QEventDispatcherGlibPrivate::QEventDispa + reinterpret_cast(g_source_new(&socketNotifierSourceFuncs, + sizeof(GSocketNotifierSource))); + (void) new (&socketNotifierSource->pollfds) QList(); ++ socketNotifierSource->processEventsFlags = QEventLoop::AllEvents; + g_source_set_can_recurse(&socketNotifierSource->source, true); + g_source_attach(&socketNotifierSource->source, mainContext); + +@@ -415,6 +423,7 @@ bool QEventDispatcherGlib::processEvents + // tell postEventSourcePrepare() and timerSource about any new flags + QEventLoop::ProcessEventsFlags savedFlags = d->timerSource->processEventsFlags; + d->timerSource->processEventsFlags = flags; ++ d->socketNotifierSource->processEventsFlags = flags; + + if (!(flags & QEventLoop::EventLoopExec)) { + // force timers to be sent at normal priority +@@ -426,6 +435,7 @@ bool QEventDispatcherGlib::processEvents + result = g_main_context_iteration(d->mainContext, canWait); + + d->timerSource->processEventsFlags = savedFlags; ++ d->socketNotifierSource->processEventsFlags = savedFlags; + + if (canWait) + emit awake(); diff --git a/libqt4-4.8.6-qclipboard_delay.patch b/libqt4-4.8.6-qclipboard_delay.patch new file mode 100644 index 0000000..22643e8 --- /dev/null +++ b/libqt4-4.8.6-qclipboard_delay.patch @@ -0,0 +1,12 @@ +--- src/gui/kernel/qclipboard_x11.cpp.sav 2014-04-25 09:52:03.855693228 +0200 ++++ src/gui/kernel/qclipboard_x11.cpp 2014-04-25 09:51:58.038693777 +0200 +@@ -548,7 +548,8 @@ bool QX11Data::clipboardWaitForEvent(Win + return false; + + XSync(X11->display, false); +- usleep(50000); ++ if (!XPending(X11->display)) ++ usleep(5000); + + now.start(); + diff --git a/libqt4-4.8.6-qclipboard_fix_recursive.patch b/libqt4-4.8.6-qclipboard_fix_recursive.patch new file mode 100644 index 0000000..6d3bf2f --- /dev/null +++ b/libqt4-4.8.6-qclipboard_fix_recursive.patch @@ -0,0 +1,94 @@ +--- src/corelib/kernel/qeventdispatcher_glib.cpp.sav 2014-03-28 15:26:37.000000000 +0100 ++++ src/corelib/kernel/qeventdispatcher_glib.cpp 2014-04-24 09:44:09.358659204 +0200 +@@ -255,22 +255,30 @@ struct GPostEventSource + GSource source; + QAtomicInt serialNumber; + int lastSerialNumber; ++ QEventLoop::ProcessEventsFlags processEventsFlags; + QEventDispatcherGlibPrivate *d; + }; + + static gboolean postEventSourcePrepare(GSource *s, gint *timeout) + { ++ GPostEventSource *source = reinterpret_cast(s); + QThreadData *data = QThreadData::current(); + if (!data) + return false; + ++ QEventLoop::ProcessEventsFlags excludeAllFlags ++ = QEventLoop::ExcludeUserInputEvents ++ | QEventLoop::ExcludeSocketNotifiers ++ | QEventLoop::X11ExcludeTimers; ++ if ((source->processEventsFlags & excludeAllFlags) == excludeAllFlags) ++ return false; ++ + gint dummy; + if (!timeout) + timeout = &dummy; + const bool canWait = data->canWaitLocked(); + *timeout = canWait ? -1 : 0; + +- GPostEventSource *source = reinterpret_cast(s); + return (!canWait + || (source->serialNumber != source->lastSerialNumber)); + } +@@ -284,8 +292,14 @@ static gboolean postEventSourceDispatch( + { + GPostEventSource *source = reinterpret_cast(s); + source->lastSerialNumber = source->serialNumber; +- QCoreApplication::sendPostedEvents(); +- source->d->runTimersOnceWithNormalPriority(); ++ QEventLoop::ProcessEventsFlags excludeAllFlags ++ = QEventLoop::ExcludeUserInputEvents ++ | QEventLoop::ExcludeSocketNotifiers ++ | QEventLoop::X11ExcludeTimers; ++ if ((source->processEventsFlags & excludeAllFlags) != excludeAllFlags) { ++ QCoreApplication::sendPostedEvents(); ++ source->d->runTimersOnceWithNormalPriority(); ++ } + return true; // i dunno, george... + } + +@@ -329,6 +343,7 @@ QEventDispatcherGlibPrivate::QEventDispa + postEventSource = reinterpret_cast(g_source_new(&postEventSourceFuncs, + sizeof(GPostEventSource))); + postEventSource->serialNumber = 1; ++ postEventSource->processEventsFlags = QEventLoop::AllEvents; + postEventSource->d = this; + g_source_set_can_recurse(&postEventSource->source, true); + g_source_attach(&postEventSource->source, mainContext); +@@ -423,6 +438,7 @@ bool QEventDispatcherGlib::processEvents + + // tell postEventSourcePrepare() and timerSource about any new flags + QEventLoop::ProcessEventsFlags savedFlags = d->timerSource->processEventsFlags; ++ d->postEventSource->processEventsFlags = flags; + d->timerSource->processEventsFlags = flags; + d->socketNotifierSource->processEventsFlags = flags; + +@@ -435,6 +451,7 @@ bool QEventDispatcherGlib::processEvents + while (!result && canWait) + result = g_main_context_iteration(d->mainContext, canWait); + ++ d->postEventSource->processEventsFlags = savedFlags; + d->timerSource->processEventsFlags = savedFlags; + d->socketNotifierSource->processEventsFlags = savedFlags; + +--- src/corelib/kernel/qeventdispatcher_unix.cpp.sav 2013-06-07 07:16:52.000000000 +0200 ++++ src/corelib/kernel/qeventdispatcher_unix.cpp 2014-04-24 09:43:06.927589535 +0200 +@@ -905,7 +905,15 @@ bool QEventDispatcherUNIX::processEvents + + // we are awake, broadcast it + emit awake(); +- QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData); ++ ++ QEventLoop::ProcessEventsFlags excludeAllFlags ++ = QEventLoop::ExcludeUserInputEvents ++ | QEventLoop::ExcludeSocketNotifiers ++ | QEventLoop::X11ExcludeTimers; ++ if ((flags & excludeAllFlags) == excludeAllFlags) ++ return false; ++ if(( flags & excludeAllFlags ) != excludeAllFlags ) ++ QCoreApplicationPrivate::sendPostedEvents(0, 0, d->threadData); + + int nevents = 0; + const bool canWait = (d->threadData->canWaitLocked() diff --git a/libqt4.spec b/libqt4.spec index ee59ad2..e11775f 100644 --- a/libqt4.spec +++ b/libqt4.spec @@ -14,7 +14,7 @@ %define _qt4_translationdir %{_qt4_datadir}/translations %define USE_DISTCC 0 -%define build_phonon 1 +%define build_phonon 0 %define build_openvg 1 %if "%{USE_DISTCC}" == "1" @@ -23,7 +23,7 @@ Name: libqt4 Version: 4.8.6 -Release: 2mamba +Release: 3mamba Summary: A multiplatform, C++ GUI application development framework Group: System/Libraries Vendor: openmamba @@ -49,6 +49,9 @@ Patch2: libqt4-4.8.1-fix_qvfb_link.patch Patch3: libqt4-4.8.2-gcc-4.7-webkit-no_Werror.patch Patch4: libqt4-4.8.2-ld-gold.patch Patch5: libqt4-4.8.4-set-alpha-flags-after-converto32-in-eglcreatesurface.patch +Patch6: libqt4-4.8.6-glib-honor-ExcludeSocketNotifiers-flag.patch +Patch7: libqt4-4.8.6-qclipboard_fix_recursive.patch +Patch8: libqt4-4.8.6-qclipboard_delay.patch License: GPL ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel @@ -541,6 +544,9 @@ Phonon development files for %{name}. %else %define platform linux-g++ %endif +%patch6 -p1 +%patch7 -p0 +%patch8 -p0 sed -i -e "s|-O2|%{optflags}|g" mkspecs/%{platform}/qmake.conf @@ -1155,6 +1161,9 @@ echo "\ %endif %changelog +* Sat Sep 20 2014 Silvan Calarco 4.8.6-3mamba +- apply patches needed by libreoffice + * Mon Jun 16 2014 Silvan Calarco 4.8.6-2mamba - rebuilt after fixing bug in gcc (see https://bugzilla.redhat.com/show_bug.cgi?id=1091482)