summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2021-03-19 15:17:42 +0100
committerJan-Marek Glogowski <glogow@fbihome.de>2021-04-05 00:30:18 +0200
commit5e53fe7b53017068d183e923f6a77f0afaf31d67 (patch)
tree954953ef1686ad0a1ebe7642889465304b09375a /vcl
parent88d3172f170fcb2e49d832b80444fd16b818deed (diff)
VCL drop Scheduler::ProcessTaskScheduling
Just process tasks (and system events) via DoYield and actually wake up the system timer on OSX. This drops the testFocus unit test. There is some comment about it in README.lifecycle, but the test's CPPUNIT_ASSERT was already commented and mmeeks suggested to simply drop it. Even worse: just replacing - Scheduler::ProcessTaskScheduling(); + Scheduler::ProcessEventsToIdle(); results in a SIGSEGV in my local Linux build, which is a totally unrelated crash. Change-Id: Ie3e2a8668b8501f081706dde0ba3684801c30cc2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112761 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/osx/salframeview.mm2
-rw-r--r--vcl/qa/cppunit/lifecycle.cxx43
-rw-r--r--vcl/source/app/salusereventlist.cxx2
-rw-r--r--vcl/source/app/scheduler.cxx14
4 files changed, 5 insertions, 56 deletions
diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm
index 517998b188ea..cbe7befabf82 100644
--- a/vcl/osx/salframeview.mm
+++ b/vcl/osx/salframeview.mm
@@ -529,7 +529,7 @@ static AquaSalFrame* getMouseContainerFrame()
if (bWasLiveResize != bIsLiveResize)
{
pInstance->mbIsLiveResize = bIsLiveResize;
- Scheduler::ProcessTaskScheduling();
+ Scheduler::Wakeup();
}
AquaSalGraphics* pGraphics = mpFrame->mpGraphics;
diff --git a/vcl/qa/cppunit/lifecycle.cxx b/vcl/qa/cppunit/lifecycle.cxx
index 6cdbbe0819d6..bf1ee3575e62 100644
--- a/vcl/qa/cppunit/lifecycle.cxx
+++ b/vcl/qa/cppunit/lifecycle.cxx
@@ -37,7 +37,6 @@ public:
void testParentedWidgets();
void testChildDispose();
void testPostDispose();
- void testFocus();
void testLeakage();
void testToolkit();
@@ -49,7 +48,6 @@ public:
CPPUNIT_TEST(testParentedWidgets);
CPPUNIT_TEST(testChildDispose);
CPPUNIT_TEST(testPostDispose);
- CPPUNIT_TEST(testFocus);
CPPUNIT_TEST(testLeakage);
CPPUNIT_TEST(testToolkit);
CPPUNIT_TEST_SUITE_END();
@@ -190,47 +188,6 @@ void LifecycleTest::testPostDispose()
namespace {
-class FocusCrashPostDispose : public TabControl
-{
-public:
- explicit FocusCrashPostDispose(vcl::Window *pParent) :
- TabControl(pParent, 0)
- {
- }
- virtual bool PreNotify( NotifyEvent& ) override
- {
- return false;
- }
- virtual bool EventNotify( NotifyEvent& ) override
- {
- return false;
- }
- virtual void GetFocus() override
- {
- CPPUNIT_FAIL("get focus");
- }
- virtual void LoseFocus() override
- {
- CPPUNIT_FAIL("this should never be called");
- }
-};
-
-}
-
-void LifecycleTest::testFocus()
-{
- ScopedVclPtrInstance<WorkWindow> xWin(nullptr, WB_APP|WB_STDWORK);
- ScopedVclPtrInstance< FocusCrashPostDispose > xChild(xWin);
- xWin->Show();
- xChild->GrabFocus();
- // process asynchronous ToTop
- Scheduler::ProcessTaskScheduling();
- // FIXME: really awful to test focus issues without showing windows.
- // CPPUNIT_ASSERT(xChild->HasFocus());
-}
-
-namespace {
-
template <class vcl_type>
class LeakTestClass : public vcl_type
{
diff --git a/vcl/source/app/salusereventlist.cxx b/vcl/source/app/salusereventlist.cxx
index 309e66bafc29..949467ae218c 100644
--- a/vcl/source/app/salusereventlist.cxx
+++ b/vcl/source/app/salusereventlist.cxx
@@ -108,7 +108,7 @@ bool SalUserEventList::DispatchUserEvents( bool bHandleAllCurrentEvents )
* Because otherwise the exception is caught somewhere totally unrelated.
* TODO Ideally we could capture a proper backtrace and feed this into breakpad,
* which is do-able, but requires writing some assembly.
- * See also Scheduler::ProcessTaskScheduling
+ * See also Scheduler::CallbackTaskScheduling
*/
#ifdef IOS
ProcessEvent( aEvent );
diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx
index ebc08e0f9a84..735792cfc3e2 100644
--- a/vcl/source/app/scheduler.cxx
+++ b/vcl/source/app/scheduler.cxx
@@ -260,12 +260,6 @@ void Scheduler::ImplStartTimer(sal_uInt64 nMS, bool bForce, sal_uInt64 nTime)
}
}
-void Scheduler::CallbackTaskScheduling()
-{
- // this function is for the saltimer callback
- Scheduler::ProcessTaskScheduling();
-}
-
static bool g_bDeterministicMode = false;
void Scheduler::SetDeterministicMode(bool bDeterministic)
@@ -333,7 +327,7 @@ static ImplSchedulerData* DropSchedulerData(
return pSchedulerDataNext;
}
-bool Scheduler::ProcessTaskScheduling()
+void Scheduler::CallbackTaskScheduling()
{
ImplSVData *pSVData = ImplGetSVData();
ImplSchedulerContext &rSchedCtx = pSVData->maSchedCtx;
@@ -342,7 +336,7 @@ bool Scheduler::ProcessTaskScheduling()
SchedulerGuard aSchedulerGuard;
if ( !rSchedCtx.mbActive || InfiniteTimeoutMs == rSchedCtx.mnTimerPeriod )
- return false;
+ return;
sal_uInt64 nTime = tools::Time::GetSystemTicks();
// Allow for decimals, so subtract in the compare (needed at least on iOS)
@@ -350,7 +344,7 @@ bool Scheduler::ProcessTaskScheduling()
{
int nSleep = rSchedCtx.mnTimerStart + rSchedCtx.mnTimerPeriod - nTime;
UpdateSystemTimer(rSchedCtx, nSleep, true, nTime);
- return false;
+ return;
}
ImplSchedulerData* pSchedulerData = nullptr;
@@ -531,8 +525,6 @@ bool Scheduler::ProcessTaskScheduling()
UpdateSystemTimer( rSchedCtx, nMinPeriod, false, nTime );
}
}
-
- return !!pMostUrgent;
}
void Scheduler::Wakeup()