summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-11-26 10:42:10 +0000
committerMichael Meeks <michael.meeks@collabora.com>2015-11-26 22:17:35 +0000
commit2c854ebae5879149261d6314061f43a379e32568 (patch)
tree2228180b83049fc3927808c6bf4f309d77086bd5 /vcl
parent5fef25ead2caecde863eb2dae2c0da3070049d1b (diff)
vcl: fix event processing to idle - for JUnit tests.
Change-Id: Ibeb1f6627815fc34c6e166357c88e076b75f6abb Reviewed-on: https://gerrit.libreoffice.org/20197 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/app/scheduler.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx
index ba90ccaca771..e17686618bb2 100644
--- a/vcl/source/app/scheduler.cxx
+++ b/vcl/source/app/scheduler.cxx
@@ -157,7 +157,7 @@ void Scheduler::CallbackTaskScheduling(bool ignore)
Scheduler::ProcessTaskScheduling( false );
}
-void Scheduler::ProcessTaskScheduling( bool bTimerOnly )
+bool Scheduler::ProcessTaskScheduling( bool bTimerOnly )
{
ImplSchedulerData* pSchedulerData;
@@ -168,6 +168,23 @@ void Scheduler::ProcessTaskScheduling( bool bTimerOnly )
pSchedulerData->mnUpdateTime = tools::Time::GetSystemTicks();
pSchedulerData->Invoke();
+ return true;
+ }
+ else
+ 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;
+ }
}
}