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

Ensure processEventsToIdle process events (including from the OS) until idle.

Change-Id: I9578849b0e78af15ddeb1e6495a48ccfb3f1c44a
Reviewed-on: https://gerrit.libreoffice.org/22651Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst 4e354737
......@@ -182,20 +182,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
......
......@@ -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);
......
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