- bnc#467278: let the previous fix work under KDE4, too

* VBA-macro-modification-warning.diff

OBS-URL: https://build.opensuse.org/package/show/LibreOffice:Factory/libreoffice?expand=0&rev=156
This commit is contained in:
Andras Timar 2014-05-23 18:50:22 +00:00 committed by Git OBS Bridge
parent 987060c34d
commit ada4f25d80
2 changed files with 53 additions and 0 deletions

View File

@ -95,3 +95,50 @@ index cf316b7..8541397 100644
--
1.8.4.5
From 39a589e1cf9340e95d63602afd272faccbaac9a5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= <l.lunak@collabora.com>
Date: Fri, 23 May 2014 18:48:53 +0200
Subject: [PATCH] force posted events before timer timeouts in KDE4 event loop
(bnc#467278)
In this particular case, basctl::Shell::onDocumentCreated() and pretty much
everything in basctl/ it seems operate on the current window. The "OnNew"
event that triggers this comes from a timeout generated who knows where
for whatever reason. However, the code "knows" what the current window
is by having basctl::Shell::SetCurWindow() react on events about the current
window changing ... which come from posted events.
So, unless it's defined somewhere that an ordering here must exist, this
is inherently racy. At least generic and Gtk event loops appear to always
deliver the posted event first, so force the same ordering in the KDE
event loop handling.
Change-Id: Ia098f6b45e6b5a5133a12a9172eb09069e6362f9
---
vcl/unx/kde4/KDEXLib.cxx | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/vcl/unx/kde4/KDEXLib.cxx b/vcl/unx/kde4/KDEXLib.cxx
index 2630c0c..9d2949e 100644
--- a/vcl/unx/kde4/KDEXLib.cxx
+++ b/vcl/unx/kde4/KDEXLib.cxx
@@ -349,6 +349,16 @@ void KDEXLib::StopTimer()
void KDEXLib::timeoutActivated()
{
+ // HACK? Always process posted events before timer timeouts.
+ // There are places that may watch both both (for example, there's a posted
+ // event about change of the current active window and there's a timeout
+ // event informing that a document has finished loading). This is of course
+ // racy, but both generic and gtk event loops manage to deliver posted events
+ // first, so it's at least consistent, and it probably kind of makes at least
+ // some sense (timeouts should be more ok to wait and be triggered somewhen).
+ while( SalKDEDisplay::self()->HasUserEvents() )
+ SalKDEDisplay::self()->DispatchInternalEvent();
+
X11SalData *pData = (X11SalData*)ImplGetSVData()->mpSalData;
pData->Timeout();
// QTimer is not single shot, so will be restarted immediatelly
--
1.8.4.5

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri May 23 18:49:38 UTC 2014 - andras.timar@collabora.com
- bnc#467278: let the previous fix work under KDE4, too
* VBA-macro-modification-warning.diff
-------------------------------------------------------------------
Thu May 22 15:53:29 UTC 2014 - andras.timar@collabora.com