- Generate autocorr content for various language mutations properly

(shamelessly stolen from Fedora).

- Use patch from upstream to handle the mutexes way better.
  Updated patch kde4-4.2.3.3-timer-mutex.patch.

OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=145
This commit is contained in:
Tomáš Chvátal 2014-05-05 13:52:23 +00:00 committed by Git OBS Bridge
parent cce26c336d
commit 9ca085debb
3 changed files with 97 additions and 43 deletions

View File

@ -1,46 +1,71 @@
From 7dba6e0a71d090f06a6a1a39e87572674593b48a Mon Sep 17 00:00:00 2001 From 71f2aff7a56cef4e133abad3c2e447c76c5ee1fe Mon Sep 17 00:00:00 2001
From: Jan-Marek Glogowski <glogow@fbihome.de> From: Luboš Luňák <l.lunak@collabora.com>
Date: Mon, 10 Mar 2014 14:44:05 +0000 Date: Tue, 25 Mar 2014 11:20:16 +0000
Subject: fdo#73115: Always run timeouts as events Subject: prevent KDE/Qt from interfering with the session manager
Right-click popup menus run click events throught the LO main loop. I occassionally get lockups in IceProcessMessages() called from QtCore,
In case of KDE4 the LO main loop is run by a timer in the main thread, I'm actually not exactly sure why, as theoretically two connections
with Qt::DirectConnection execution. 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, Change-Id: Iebe20d4cb5403e5fea8bd5d8c1f69b62d1c2907b
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 <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
--- ---
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx 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 --- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx +++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -67,9 +67,13 @@ KDEXLib::KDEXLib() : @@ -166,8 +166,23 @@ void KDEXLib::Init()
eventLoopType( LibreOfficeEventLoop ),
m_bYieldFrozen( false ) KCmdLineArgs::init( m_nFakeCmdLineArgs, m_pAppCmdLineArgs, kAboutData );
{
- // the timers created here means they belong to the main thread + // LO does its own session management, so prevent KDE/Qt from interfering
- connect( &timeoutTimer, SIGNAL( timeout()), this, SLOT( timeoutActivated())); + // (QApplication::disableSessionManagement(false) wouldn't quite do,
- connect( &userEventTimer, SIGNAL( timeout()), this, SLOT( userEventActivated())); + // since that still actually connects to the session manager, it just
+ // the timers created here means they belong to the main thread. + // won't save the application data on session shutdown).
+ // As the timeoutTimer runs the LO event queue, which may block on a dialog, + char* session_manager = NULL;
+ // the timer has to use a Qt::QueuedConnection, otherwise the nested event + if( getenv( "SESSION_MANAGER" ) != NULL )
+ // loop will detect the blocking timer and drop it from the polling + {
+ // freezing LO X11 processing. + session_manager = strdup( getenv( "SESSION_MANAGER" ));
+ connect( &timeoutTimer, SIGNAL( timeout()), this, SLOT( timeoutActivated()), Qt::QueuedConnection ); + unsetenv( "SESSION_MANAGER" );
+ connect( &userEventTimer, SIGNAL( timeout()), this, SLOT( userEventActivated()), Qt::QueuedConnection ); + }
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 <QSessionManager>
-
#include <kapplication.h>
#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 cgit v0.9.0.2-2-gbebe

View File

@ -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 Mon May 5 07:14:50 UTC 2014 - tchvatal@suse.com

View File

@ -627,6 +627,15 @@ This package provides extensions for LibreOffice Writer:
- MediaWiki Publisher - 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 # Symlinking macro for /usr/lib64 and /usr/share packing
# As argument takes name of the package # As argument takes name of the package
%define _link_noarch_files() \ %define _link_noarch_files() \
@ -1090,12 +1099,20 @@ for file in sofficerc \
echo "%{_datadir}/%{name}/program/$file" >> file-lists/branding_upstream.txt echo "%{_datadir}/%{name}/program/$file" >> file-lists/branding_upstream.txt
done done
################ # Fix autocorr names for various language mutations
# FIXME: fast hack to solve a customer issue, n#364523 %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
# we need a more generic solution %make_autocorr_aliases -l en-US en-PH
# FIXME: can be done better, see how fedora does it and imitate %make_autocorr_aliases -l en-ZA en-NA en-ZW
ln -sf acor_fr-FR.dat %{buildroot}%{_libdir}/%{name}/share/autocorr/acor_fr-CA.dat %make_autocorr_aliases -l af-ZA af-NA
echo "%{_libdir}/%{name}/share/autocorr/acor_fr-CA.dat" >>file-lists/common_list.txt %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 # Symlink uno.py and unohelper.py so that python can find them
mkdir -p %{buildroot}%{python_sitelib} mkdir -p %{buildroot}%{python_sitelib}