From 65b5d74b7af6d2ee85b193a64f87ba057f02b1f0 Mon Sep 17 00:00:00 2001 From: louis Date: Tue, 22 Mar 2016 16:55:46 +0100 Subject: fixed bug that onpause view potentially starts during setting cutting marks --- coreengine/animation.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'coreengine/animation.c') diff --git a/coreengine/animation.c b/coreengine/animation.c index 863527c..735d309 100644 --- a/coreengine/animation.c +++ b/coreengine/animation.c @@ -11,6 +11,7 @@ cAnimation::cAnimation(cScrollable *scrollable) : cThread("scroller") { this->shiftable = NULL; this->blinkable = NULL; waitOnWakeup = false; + keepSleeping = false; doAnimation = true; modeIn = false; blinkFunc = -1; @@ -23,6 +24,7 @@ cAnimation::cAnimation(cDetachable *detachable, bool wait, bool animation) : cTh this->shiftable = NULL; this->blinkable = NULL; waitOnWakeup = wait; + keepSleeping = false; doAnimation = animation; modeIn = false; blinkFunc = -1; @@ -35,6 +37,7 @@ cAnimation::cAnimation(cFadable *fadable, bool fadein) : cThread("fadable") { this->shiftable = NULL; this->blinkable = NULL; waitOnWakeup = false; + keepSleeping = false; doAnimation = true; modeIn = fadein; blinkFunc = -1; @@ -47,6 +50,7 @@ cAnimation::cAnimation(cShiftable *shiftable, cPoint &start, cPoint &end, bool s this->shiftable = shiftable; this->blinkable = NULL; waitOnWakeup = false; + keepSleeping = false; doAnimation = true; modeIn = shiftin; shiftstart = start; @@ -61,6 +65,7 @@ cAnimation::cAnimation(cBlinkable *blinkable, int func) : cThread("blinking") { this->shiftable = NULL; this->blinkable = blinkable; waitOnWakeup = false; + keepSleeping = false; doAnimation = true; modeIn = false; blinkFunc = func; @@ -75,6 +80,11 @@ void cAnimation::WakeUp(void) { sleepWait.Signal(); } +void cAnimation::ResetSleep(void) { + keepSleeping = true; + sleepWait.Signal(); +} + void cAnimation::Stop(bool deletePixmaps) { sleepWait.Signal(); Cancel(2); @@ -100,7 +110,10 @@ void cAnimation::Sleep(int duration) { //sleep should wake up itself, so no infinit wait allowed if (duration <= 0) return; - sleepWait.Wait(duration); + do { + keepSleeping = false; + sleepWait.Wait(duration); + } while (keepSleeping); } void cAnimation::Wait(void) { -- cgit v1.2.3