[Libreoffice-commits] core.git: Branch 'libreoffice-5-1-1' - vcl/source
Michael Meeks
michael.meeks at collabora.com
Wed Feb 24 15:06:55 UTC 2016
vcl/source/app/scheduler.cxx | 14 --------------
vcl/source/app/svapp.cxx | 18 +++++++++++++++++-
2 files changed, 17 insertions(+), 15 deletions(-)
New commits:
commit cce375f959e4d29f022538ef9942a7558ec53ce2
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Thu Feb 18 21:18:28 2016 +0000
Ensure processEventsToIdle process events (including from the OS) until idle.
Change-Id: I9578849b0e78af15ddeb1e6495a48ccfb3f1c44a
Reviewed-on: https://gerrit.libreoffice.org/22653
Reviewed-by: Marco Cecchetti <mrcekets at gmail.com>
Tested-by: Marco Cecchetti <mrcekets at gmail.com>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
Reviewed-by: Andras Timar <andras.timar at collabora.com>
diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx
index 9450393..879ca42 100644
--- a/vcl/source/app/scheduler.cxx
+++ b/vcl/source/app/scheduler.cxx
@@ -174,20 +174,6 @@ bool Scheduler::ProcessTaskScheduling( bool bTimerOnly )
return false;
}
-void Scheduler::ProcessEventsToIdle()
-{
- // FIXME: really we should process incoming OS events too ...
- int nSanity = 1000;
- while (Scheduler::ProcessTaskScheduling(false))
- {
- if (nSanity-- < 0)
- {
- SAL_WARN("vcl.schedule", "Unexpected volume of events to process");
- break;
- }
- }
-}
-
sal_uInt64 Scheduler::CalculateMinimumTimeout( bool &bHasActiveIdles )
{
// process all pending Tasks
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index ef0847d..755c821 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -473,7 +473,7 @@ void Application::Execute()
pSVData->maAppData.mbInAppExecute = false;
}
-inline void ImplYield(bool i_bWait, bool i_bAllEvents, sal_uLong const nReleased)
+inline bool ImplYield(bool i_bWait, bool i_bAllEvents, sal_uLong const nReleased)
{
ImplSVData* pSVData = ImplGetSVData();
@@ -523,6 +523,8 @@ inline void ImplYield(bool i_bWait, bool i_bAllEvents, sal_uLong const nReleased
vcl::LazyDelete::flush();
SAL_INFO("vcl.schedule", "Leave ImplYield");
+
+ return bHasActiveIdles || eResult == SalYieldResult::EVENT;
}
void Application::Reschedule( bool i_bAllEvents )
@@ -530,6 +532,20 @@ void Application::Reschedule( bool i_bAllEvents )
ImplYield(false, i_bAllEvents, 0);
}
+void Scheduler::ProcessEventsToIdle()
+{
+ int nSanity = 1000;
+ while(ImplYield(false, false, 0) ||
+ Scheduler::ProcessTaskScheduling(false))
+ {
+ if (nSanity-- < 0)
+ {
+ SAL_WARN("vcl.schedule", "Unexpected volume of events to process");
+ break;
+ }
+ }
+}
+
void Application::Yield()
{
ImplYield(true, false, 0);
More information about the Libreoffice-commits
mailing list