Kaydet (Commit) fbdeef6b authored tarafından Michael Meeks's avatar Michael Meeks

vcl: fix event processing to idle - for JUnit tests.

Change-Id: Ibeb1f6627815fc34c6e166357c88e076b75f6abb
Reviewed-on: https://gerrit.libreoffice.org/20197Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Tested-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst efa5c543
......@@ -92,8 +92,10 @@ public:
static void CallbackTaskScheduling( bool ignore );
/// Calculate minimum timeout - and return its value.
static sal_uInt64 CalculateMinimumTimeout( bool &bHasActiveIdles );
/// Process one pending task ahead of time with highhest priority.
static void ProcessTaskScheduling( bool bTimer );
/// Process one pending task ahead of time with highest priority.
static bool ProcessTaskScheduling( bool bTimerOnly );
/// Process all events until we are idle
static void ProcessEventsToIdle();
};
#endif // INCLUDED_VCL_SCHEDULER_HXX
......
......@@ -1912,7 +1912,7 @@ void SAL_CALL VCLXToolkit::processEventsToIdle()
throw (css::uno::RuntimeException, std::exception)
{
SolarMutexGuard aSolarGuard;
Scheduler::ProcessTaskScheduling(false);
Scheduler::ProcessEventsToIdle();
}
OUString SAL_CALL VCLXToolkit::getHWOSConfInfo()
......
......@@ -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;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment