Skip to content

Commit

Permalink
Merge pull request xbmc#8166 from koying/fixdroidrefreshI
Browse files Browse the repository at this point in the history
FIX: [droid] use renderer resolution when available
  • Loading branch information
MartijnKaijser committed Oct 3, 2015
2 parents 90d2788 + 3434724 commit 6bbcb62
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion xbmc/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,8 @@ bool CApplication::CreateGUI()

bool CApplication::InitWindow()
{
RESOLUTION res = CDisplaySettings::Get().GetCurrentResolution();

#ifdef TARGET_DARWIN_OSX
// force initial window creation to be windowed, if fullscreen, it will switch to it below
// fixes the white screen of death if starting fullscreen and switching to windowed.
Expand All @@ -824,6 +826,18 @@ bool CApplication::InitWindow()
CLog::Log(LOGFATAL, "CApplication::Create: Unable to create window");
return false;
}
#elif defined(TARGET_ANDROID)
// We might come from a refresh rate switch destroying the native window; use the renderer resolution
if (g_graphicsContext.GetVideoResolution() != RES_INVALID)
res = g_graphicsContext.GetVideoResolution();
RESOLUTION_INFO res_info = CDisplaySettings::Get().GetResolutionInfo(res);

bool bFullScreen = res != RES_WINDOW;
if (!g_Windowing.CreateNewWindow(CSysInfo::GetAppName(), bFullScreen, res_info, OnEvent))
{
CLog::Log(LOGFATAL, "CApplication::Create: Unable to create window");
return false;
}
#else
bool bFullScreen = CDisplaySettings::Get().GetCurrentResolution() != RES_WINDOW;
if (!g_Windowing.CreateNewWindow(CSysInfo::GetAppName(), bFullScreen, CDisplaySettings::Get().GetCurrentResolutionInfo(), OnEvent))
Expand All @@ -839,7 +853,7 @@ bool CApplication::InitWindow()
return false;
}
// set GUI res and force the clear of the screen
g_graphicsContext.SetVideoResolution(CDisplaySettings::Get().GetCurrentResolution());
g_graphicsContext.SetVideoResolution(res);
return true;
}

Expand Down

0 comments on commit 6bbcb62

Please sign in to comment.