diff options
Diffstat (limited to 'displaymenu.c')
-rw-r--r-- | displaymenu.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/displaymenu.c b/displaymenu.c index 46be742..bbd27e1 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -35,10 +35,9 @@ cNopacityDisplayMenu::cNopacityDisplayMenu(void) { } cNopacityDisplayMenu::~cNopacityDisplayMenu() { - if (Running()) { - Cancel(); - cCondWait::SleepMs(300); - } + Cancel(-1); + while (Active()) + cCondWait::SleepMs(10); delete menuView; menuItems.Clear(); if (detailView) { @@ -472,7 +471,7 @@ void cNopacityDisplayMenu::Flush(void) { DrawTimers(); } if (initial) { - if (FadeTime) + if (config.menuFadeTime) Start(); } initMenu = false; @@ -486,21 +485,21 @@ void cNopacityDisplayMenu::Action(void) { uint64_t Now = cTimeMs::Now(); cPixmap::Lock(); double t = min(double(Now - Start) / FadeTime, 1.0); - int Alpha = t * ALPHA_OPAQUE; + int Alpha = t * ALPHA_OPAQUE; menuView->SetPixmapAlpha(Alpha); - for (cNopacityMenuItem *item = menuItems.First(); item; item = menuItems.Next(item)) { + for (cNopacityMenuItem *item = menuItems.First(); Running() && item; item = menuItems.Next(item)) { item->SetAlpha(Alpha); item->SetAlphaIcon(Alpha); } - for (cNopacityTimer *t = timers.First(); t; t = timers.Next(t)) { + for (cNopacityTimer *t = timers.First(); Running() && t; t = timers.Next(t)) t->SetAlpha(Alpha); - } - osd->Flush(); + if (Running()) + osd->Flush(); cPixmap::Unlock(); - int Delta = cTimeMs::Now() - Now; - if (Delta < FrameTime) - cCondWait::SleepMs(FrameTime - Delta); + int Delta = cTimeMs::Now() - Now; + if (Running() && (Delta < FrameTime)) + cCondWait::SleepMs(FrameTime - Delta); if ((int)(Now - Start) > FadeTime) break; - } + } } |