Skip to content

Commit ad7ee3f

Browse files
committed
Fix the frontend entering 'manual' standby mode instead of 'automatic' standby mode. The net effect of which being that you can only exit standby by pressing escape when any input should have exited.
1 parent 7ccf016 commit ad7ee3f

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

mythtv/libs/libmythui/mythmainwindow.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ class MythMainWindowPrivate
188188
m_pendingUpdate(false),
189189

190190
idleTimer(NULL),
191-
standby(false)
191+
standby(false),
192+
enteringStandby(false)
192193
{
193194
}
194195

@@ -279,6 +280,7 @@ class MythMainWindowPrivate
279280

280281
QTimer *idleTimer;
281282
bool standby;
283+
bool enteringStandby;
282284
};
283285

284286
// Make keynum in QKeyEvent be equivalent to what's in QKeySequence
@@ -2570,8 +2572,7 @@ void MythMainWindow::HideMouseTimeout(void)
25702572

25712573
void MythMainWindow::ResetIdleTimer(void)
25722574
{
2573-
// If the timer isn't active then it's been paused
2574-
if (!d->idleTimer->isActive())
2575+
if (d->standby && d->enteringStandby)
25752576
return;
25762577

25772578
if (d->standby)
@@ -2592,6 +2593,7 @@ void MythMainWindow::PauseIdleTimer(bool pause)
25922593

25932594
void MythMainWindow::IdleTimeout(void)
25942595
{
2596+
d->enteringStandby = false;
25952597

25962598
int idletimeout = gCoreContext->GetNumSetting("FrontendIdleTimeout",
25972599
STANDBY_TIMEOUT);
@@ -2602,21 +2604,16 @@ void MythMainWindow::IdleTimeout(void)
26022604
"%1 minutes of inactivity")
26032605
.arg(idletimeout));
26042606
EnterStandby(false);
2605-
2606-
// HACK Prevent faked keypresses interrupting the transition to standby
2607-
PauseIdleTimer(true);
2608-
// HACK end
2609-
2607+
d->enteringStandby = true;
26102608
JumpTo("Standby Mode");
2611-
2612-
// HACK
2613-
PauseIdleTimer(false);
2614-
// HACK end
26152609
}
26162610
}
26172611

26182612
void MythMainWindow::EnterStandby(bool manual)
26192613
{
2614+
if (manual && d->enteringStandby)
2615+
d->enteringStandby = false;
2616+
26202617
if (d->standby)
26212618
return;
26222619

@@ -2634,6 +2631,9 @@ void MythMainWindow::EnterStandby(bool manual)
26342631

26352632
void MythMainWindow::ExitStandby(bool manual)
26362633
{
2634+
if (d->enteringStandby)
2635+
return;
2636+
26372637
if (manual)
26382638
PauseIdleTimer(false);
26392639
else

0 commit comments

Comments
 (0)