summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Kendall <mkendall@mythtv.org>2011-02-14 12:45:59 (GMT)
committer Mark Kendall <mkendall@mythtv.org>2011-02-15 00:53:38 (GMT)
commit8332e50300ae3f17fdcb8af1fa1b60d62c03237f (patch)
tree0cca170fe5b8dee71ec89898f1222aafa57cecfc
parent4055a5e7500a665d56bdd9bb90ace64a0e05d268 (diff)
TV: Hide and disable the main UI at the last moment.
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 4ae3c0d092d441cb9289454623e514d9c13a6d95)
-rw-r--r--mythtv/libs/libmythtv/tv_play.cpp25
1 files changed, 8 insertions, 17 deletions
diff --git a/mythtv/libs/libmythtv/tv_play.cpp b/mythtv/libs/libmythtv/tv_play.cpp
index fbb5d2b..1c673c9 100644
--- a/mythtv/libs/libmythtv/tv_play.cpp
+++ b/mythtv/libs/libmythtv/tv_play.cpp
@@ -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
@@ -2044,7 +2037,6 @@ void TV::HandleStateChange(PlayerContext *mctx, PlayerContext *ctx)
}
else if (!ctx->IsPIP())
{
- GetMythUI()->DisableScreensaver();
if (!lastLockSeenTime.isValid() ||
(lastLockSeenTime < timerOffTime))
{
@@ -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__);
@@ -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(
@@ -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 +