Skip to content

Commit

Permalink
Merge pull request xbmc#17574 from ksooo/fix-issue17556
Browse files Browse the repository at this point in the history
[application] Fix black screen when switching from PVR Live TV channel to PVR Radio channel.
  • Loading branch information
ksooo authored and Maven85 committed Aug 5, 2020
1 parent f17c11c commit 978a2f7
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions xbmc/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2101,10 +2101,7 @@ void CApplication::OnApplicationMessage(ThreadMessage* pMsg)


case TMSG_SWITCHTOFULLSCREEN:
if (CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() != WINDOW_FULLSCREEN_VIDEO &&
CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() != WINDOW_FULLSCREEN_GAME &&
CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() != WINDOW_VISUALISATION)
SwitchToFullScreen(true);
SwitchToFullScreen(true);
break;

case TMSG_VIDEORESIZE:
Expand Down Expand Up @@ -4561,8 +4558,10 @@ void CApplication::SeekPercentage(float percent)
// SwitchToFullScreen() returns true if a switch is made, else returns false
bool CApplication::SwitchToFullScreen(bool force /* = false */)
{
const int activeWindowID = CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow();

// don't switch if the slideshow is active
if (CServiceBroker::GetGUI()->GetWindowManager().IsWindowActive(WINDOW_SLIDESHOW))
if (activeWindowID == WINDOW_SLIDESHOW)
return false;

// if playing from the video info window, close it first!
Expand Down Expand Up @@ -4592,25 +4591,25 @@ bool CApplication::SwitchToFullScreen(bool force /* = false */)

int windowID = WINDOW_INVALID;

// See if we're playing a game, and are in GUI mode
if (m_appPlayer.IsPlayingGame() && CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() != WINDOW_FULLSCREEN_GAME)
// See if we're playing a game
if (activeWindowID != WINDOW_FULLSCREEN_GAME && m_appPlayer.IsPlayingGame())
windowID = WINDOW_FULLSCREEN_GAME;

// See if we're playing a video, and are in GUI mode
else if (m_appPlayer.IsPlayingVideo() && CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() != WINDOW_FULLSCREEN_VIDEO)
// See if we're playing a video
else if (activeWindowID != WINDOW_FULLSCREEN_VIDEO && m_appPlayer.IsPlayingVideo())
windowID = WINDOW_FULLSCREEN_VIDEO;

// special case for switching between GUI & visualisation mode. (only if we're playing an audio song)
if (m_appPlayer.IsPlayingAudio() && CServiceBroker::GetGUI()->GetWindowManager().GetActiveWindow() != WINDOW_VISUALISATION)
// See if we're playing an audio song
if (activeWindowID != WINDOW_VISUALISATION && m_appPlayer.IsPlayingAudio())
windowID = WINDOW_VISUALISATION;


if (windowID != WINDOW_INVALID)
if (windowID != WINDOW_INVALID && (force || windowID != activeWindowID))
{
if (force)
CServiceBroker::GetGUI()->GetWindowManager().ForceActivateWindow(windowID);
else
CServiceBroker::GetGUI()->GetWindowManager().ActivateWindow(windowID);

return true;
}

Expand Down

0 comments on commit 978a2f7

Please sign in to comment.