aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris "Koying" Browet <cbro@semperpax.com>2015-09-27 12:41:03 +0200
committerChris "koying" Browet <cbro@semperpax.com>2015-10-01 17:21:28 +0200
commit34347243837429d2736654e903d3a67d6a8ec632 (patch)
tree7cf9a8ca3671d41348b632197200961fa0f5ba22
parent90d27881941decee4b4f35f5cdd9c2dd2a387d0b (diff)
FIX: [droid] use renderer resolution when available
When switching refresh rate, the native window is destroyed and recreated, so use the rendere resolution if available to avoid being reset to the setting resolution
-rw-r--r--xbmc/Application.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index a891be6a39..bc6f4a2a08 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -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.
@@ -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))
@@ -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;
}