summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2016-02-18 21:18:28 +0000
committerAndras Timar <andras.timar@collabora.com>2016-02-24 13:41:33 +0000
commitc5292a52b20466f0259f638332452c4a87e038a8 (patch)
tree2e69330d3a0d6c4b54dff7d962d164a0c34c5f07 /vcl/source
parent2ee228e179d98630bc69cef8b13a55c0edbe9e1b (diff)
Ensure processEventsToIdle process events (including from the OS) until idle.
Change-Id: I9578849b0e78af15ddeb1e6495a48ccfb3f1c44a Reviewed-on: https://gerrit.libreoffice.org/22651 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com> (cherry picked from commit b952aaacb1a6ef628226ef2699fac9fab936f20b) Reviewed-on: https://gerrit.libreoffice.org/22652 Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/app/scheduler.cxx14
-rw-r--r--vcl/source/app/svapp.cxx18
2 files changed, 17 insertions, 15 deletions
diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx
index 94503931ac4c..879ca422a5ac 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 0270b8c9578a..a75a6db2f3bf 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(Scheduler::ProcessTaskScheduling(false) ||
+ ImplYield(false, false, 0))
+ {
+ if (nSanity-- < 0)
+ {
+ SAL_WARN("vcl.schedule", "Unexpected volume of events to process");
+ break;
+ }
+ }
+}
+
void Application::Yield()
{
ImplYield(true, false, 0);