diff --git a/kde4-4.2.3.3-timer-mutex.patch b/kde4-4.2.3.3-timer-mutex.patch index 025550a..0528e22 100644 --- a/kde4-4.2.3.3-timer-mutex.patch +++ b/kde4-4.2.3.3-timer-mutex.patch @@ -1,46 +1,71 @@ -From 7dba6e0a71d090f06a6a1a39e87572674593b48a Mon Sep 17 00:00:00 2001 -From: Jan-Marek Glogowski -Date: Mon, 10 Mar 2014 14:44:05 +0000 -Subject: fdo#73115: Always run timeouts as events +From 71f2aff7a56cef4e133abad3c2e447c76c5ee1fe Mon Sep 17 00:00:00 2001 +From: Luboš Luňák +Date: Tue, 25 Mar 2014 11:20:16 +0000 +Subject: prevent KDE/Qt from interfering with the session manager -Right-click popup menus run click events throught the LO main loop. -In case of KDE4 the LO main loop is run by a timer in the main thread, -with Qt::DirectConnection execution. +I occassionally get lockups in IceProcessMessages() called from QtCore, +I'm actually not exactly sure why, as theoretically two connections +from one app shouldn't be a problem, but since LO does its own +session handling, there's no need to the KDE/Qt code to be involved, +so prevent it from connecting to the session manager altogether. -If the timeout actually starts a nested event loop for a new dialog, -the timer is blocked, the nested mainloop detects it was started -from the timeout and drops the blocked timout from polling, which -blocks any further LibreOffice event loop processing. - -This changes the timers to Qt::QueuedConnection, so they always -generate an event and are processed by the Qt event loop. - -Change-Id: Ie626b22be3d8f9b8934bcc5e9e0e67a365549cfc -(cherry picked from commit aeda478a02523cec146f6af69710f0391061db56) -Reviewed-on: https://gerrit.libreoffice.org/8514 -Reviewed-by: Caolán McNamara -Tested-by: Caolán McNamara +Change-Id: Iebe20d4cb5403e5fea8bd5d8c1f69b62d1c2907b --- diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx -index b4be6d6..4a9b70b 100644 +index 820d39a..e4900a7 100644 --- a/vcl/unx/kde4/KDEXLib.cxx +++ b/vcl/unx/kde4/KDEXLib.cxx -@@ -67,9 +67,13 @@ KDEXLib::KDEXLib() : - eventLoopType( LibreOfficeEventLoop ), - m_bYieldFrozen( false ) - { -- // the timers created here means they belong to the main thread -- connect( &timeoutTimer, SIGNAL( timeout()), this, SLOT( timeoutActivated())); -- connect( &userEventTimer, SIGNAL( timeout()), this, SLOT( userEventActivated())); -+ // the timers created here means they belong to the main thread. -+ // As the timeoutTimer runs the LO event queue, which may block on a dialog, -+ // the timer has to use a Qt::QueuedConnection, otherwise the nested event -+ // loop will detect the blocking timer and drop it from the polling -+ // freezing LO X11 processing. -+ connect( &timeoutTimer, SIGNAL( timeout()), this, SLOT( timeoutActivated()), Qt::QueuedConnection ); -+ connect( &userEventTimer, SIGNAL( timeout()), this, SLOT( userEventActivated()), Qt::QueuedConnection ); +@@ -166,8 +166,23 @@ void KDEXLib::Init() + + KCmdLineArgs::init( m_nFakeCmdLineArgs, m_pAppCmdLineArgs, kAboutData ); + ++ // LO does its own session management, so prevent KDE/Qt from interfering ++ // (QApplication::disableSessionManagement(false) wouldn't quite do, ++ // since that still actually connects to the session manager, it just ++ // won't save the application data on session shutdown). ++ char* session_manager = NULL; ++ if( getenv( "SESSION_MANAGER" ) != NULL ) ++ { ++ session_manager = strdup( getenv( "SESSION_MANAGER" )); ++ unsetenv( "SESSION_MANAGER" ); ++ } + m_pApplication = new VCLKDEApplication(); +- kapp->disableSessionManagement(); ++ if( session_manager != NULL ) ++ { ++ setenv( "SESSION_MANAGER", session_manager, 1 ); ++ free( session_manager ); ++ } ++ + KApplication::setQuitOnLastWindowClosed(false); + + #if KDE_HAVE_GLIB +diff --git a/vcl/unx/kde4/VCLKDEApplication.hxx b/vcl/unx/kde4/VCLKDEApplication.hxx +index 412ee34..4ce0b2c 100644 +--- a/vcl/unx/kde4/VCLKDEApplication.hxx ++++ b/vcl/unx/kde4/VCLKDEApplication.hxx +@@ -21,22 +21,14 @@ + + #define Region QtXRegion + +-#include +- + #include + + #undef Region + +-/* #i59042# override KApplications method for session management +- * since it will interfere badly with our own. +- */ + class VCLKDEApplication : public KApplication + { + public: + VCLKDEApplication(); +- +- virtual void commitData(QSessionManager&) {}; +- + virtual bool x11EventFilter(XEvent* event); + }; - // QTimer::start() can be called only in its (here main) thread, so this will - // forward between threads if needed -- cgit v0.9.0.2-2-gbebe diff --git a/libreoffice.changes b/libreoffice.changes index 3fba759..f70fc4c 100644 --- a/libreoffice.changes +++ b/libreoffice.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Mon May 5 13:35:28 UTC 2014 - tchvatal@suse.com + +- Generate autocorr content for various language mutations properly + (shamelessly stolen from Fedora). + +------------------------------------------------------------------- +Mon May 5 13:24:33 UTC 2014 - tchvatal@suse.com + +- Use patch from upstream to handle the mutexes way better. + Updated patch kde4-4.2.3.3-timer-mutex.patch. + ------------------------------------------------------------------- Mon May 5 07:14:50 UTC 2014 - tchvatal@suse.com diff --git a/libreoffice.spec b/libreoffice.spec index e8c7296..97295b3 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -627,6 +627,15 @@ This package provides extensions for LibreOffice Writer: - MediaWiki Publisher +# Symlink autocorr files for various conversion items +%define make_autocorr_aliases(l:) \ +%{?-l: \ +for lang in %{*}; do \ + ln -sf acor_%{-l*}.dat %{buildroot}%{_libdir}/%{name}/share/autocorr/acor_$lang.dat \ +done \ +} \ +%{!?-l:%{error:-l must be present}} + # Symlinking macro for /usr/lib64 and /usr/share packing # As argument takes name of the package %define _link_noarch_files() \ @@ -1090,12 +1099,20 @@ for file in sofficerc \ echo "%{_datadir}/%{name}/program/$file" >> file-lists/branding_upstream.txt done -################ -# FIXME: fast hack to solve a customer issue, n#364523 -# we need a more generic solution -# FIXME: can be done better, see how fedora does it and imitate -ln -sf acor_fr-FR.dat %{buildroot}%{_libdir}/%{name}/share/autocorr/acor_fr-CA.dat -echo "%{_libdir}/%{name}/share/autocorr/acor_fr-CA.dat" >>file-lists/common_list.txt +# Fix autocorr names for various language mutations +%make_autocorr_aliases -l en-GB en-AG en-AU en-BS en-BW en-BZ en-CA en-DK en-GH en-HK en-IE en-IN en-JM en-NG en-NZ en-SG en-TT +%make_autocorr_aliases -l en-US en-PH +%make_autocorr_aliases -l en-ZA en-NA en-ZW +%make_autocorr_aliases -l af-ZA af-NA +%make_autocorr_aliases -l de-DE de-AT de-BE de-CH de-LI de-LU +%make_autocorr_aliases -l es-ES es-AR es-BO es-CL es-CO es-CR es-CU es-DO es-EC es-GT es-HN es-MX es-NI es-PA es-PE es-PR es-PY es-SV es-US es-UY es-VE +%make_autocorr_aliases -l fr-FR fr-BE fr-CA fr-CH fr-LU fr-MC +%make_autocorr_aliases -l it-IT it-CH +%make_autocorr_aliases -l nl-NL nl-AW +%make_autocorr_aliases -l sv-SE sv-FI +for file in %{buildroot}%{_libdir}/%{name}/share/autocorr/acor*.dat ; do + echo "$file" >> file-lists/common_list.txt +done # Symlink uno.py and unohelper.py so that python can find them mkdir -p %{buildroot}%{python_sitelib}