Skip to content

Commit

Permalink
TV: Hide and disable the main UI at the last moment.
Browse files Browse the repository at this point in the history
This consolidates some duplicated code in TV::HandleStateChange to
ensure that the various actions required to hide and disable the main ui
(and screensaver) are the last significant actions before we enter the
main playback loop.
(cherry picked from commit 4ae3c0d)
  • Loading branch information
Mark Kendall committed Feb 15, 2011
1 parent 4055a5e commit 8332e50
Showing 1 changed file with 8 additions and 17 deletions.
25 changes: 8 additions & 17 deletions mythtv/libs/libmythtv/tv_play.cpp
Expand Up @@ -2020,13 +2020,6 @@ void TV::HandleStateChange(PlayerContext *mctx, PlayerContext *ctx)

VERBOSE(VB_IMPORTANT, "We have a RingBuffer");

if (GetMythMainWindow() && !weDisabledGUI)
{
weDisabledGUI = true;
GetMythMainWindow()->PushDrawDisabled();
DrawUnusedRects();
}

if (ctx->playingInfo && StartRecorder(ctx,-1))
{
// Cache starting frame rate for this recorder
Expand All @@ -2044,7 +2037,6 @@ void TV::HandleStateChange(PlayerContext *mctx, PlayerContext *ctx)
}
else if (!ctx->IsPIP())
{
GetMythUI()->DisableScreensaver();
if (!lastLockSeenTime.isValid() ||
(lastLockSeenTime < timerOffTime))
{
Expand Down Expand Up @@ -2092,15 +2084,6 @@ void TV::HandleStateChange(PlayerContext *mctx, PlayerContext *ctx)

if (ctx->buffer && ctx->buffer->IsOpen())
{
GetMythUI()->DisableScreensaver();

if (GetMythMainWindow() && !weDisabledGUI)
{
weDisabledGUI = true;
GetMythMainWindow()->PushDrawDisabled();
DrawUnusedRects();
}

if (desiredNextState == kState_WatchingRecording)
{
ctx->LockPlayingInfo(__FILE__, __LINE__);
Expand Down Expand Up @@ -2252,6 +2235,8 @@ void TV::HandleStateChange(PlayerContext *mctx, PlayerContext *ctx)
TRANSITION(kState_None, kState_WatchingRecording) ||
TRANSITION(kState_None, kState_WatchingLiveTV))
{
if (!ctx->IsPIP())
GetMythUI()->DisableScreensaver();
MythMainWindow *mainWindow = GetMythMainWindow();
mainWindow->setBaseSize(player_bounds.size());
mainWindow->setMinimumSize(
Expand All @@ -2261,6 +2246,12 @@ void TV::HandleStateChange(PlayerContext *mctx, PlayerContext *ctx)
QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
mainWindow->setGeometry(player_bounds);
GetMythMainWindow()->GetPaintWindow()->hide();
if (!weDisabledGUI)
{
weDisabledGUI = true;
GetMythMainWindow()->PushDrawDisabled();
}
DrawUnusedRects();
}

VERBOSE(VB_PLAYBACK, LOC +
Expand Down

0 comments on commit 8332e50

Please sign in to comment.