@@ -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
25712573void 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
25932594void 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
26182612void 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
26352632void MythMainWindow::ExitStandby (bool manual)
26362633{
2634+ if (d->enteringStandby )
2635+ return ;
2636+
26372637 if (manual)
26382638 PauseIdleTimer (false );
26392639 else
0 commit comments