aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris "koying" Browet <cbro@semperpax.com>2015-10-16 15:21:29 +0200
committerChris "Koying" Browet <cbro@semperpax.com>2015-10-16 20:01:43 +0200
commit0203ac5fa879e4a3243f42f14a1d99433be396ff (patch)
tree65f6b0557041a4d6851890d6cda65aa42caf9ada
parent982cedee1b442adf33407cebe2b712dc34756865 (diff)
FIX: [droid] use context resolution when recreating window
-rw-r--r--xbmc/Application.cpp16
-rw-r--r--xbmc/Application.h3
2 files changed, 13 insertions, 6 deletions
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index d4e059dd10..8007c10a1d 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -826,10 +826,13 @@ bool CApplication::CreateGUI()
return true;
}
-bool CApplication::InitWindow()
+bool CApplication::InitWindow(RESOLUTION res)
{
- bool bFullScreen = CDisplaySettings::GetInstance().GetCurrentResolution() != RES_WINDOW;
- if (!g_Windowing.CreateNewWindow(CSysInfo::GetAppName(), bFullScreen, CDisplaySettings::GetInstance().GetCurrentResolutionInfo(), OnEvent))
+ if (res == RES_INVALID)
+ res = CDisplaySettings::GetInstance().GetCurrentResolution();
+
+ bool bFullScreen = res != RES_WINDOW;
+ if (!g_Windowing.CreateNewWindow(CSysInfo::GetAppName(), bFullScreen, CDisplaySettings::GetInstance().GetResolutionInfo(res), OnEvent))
{
CLog::Log(LOGFATAL, "CApplication::Create: Unable to create window");
return false;
@@ -841,7 +844,7 @@ bool CApplication::InitWindow()
return false;
}
// set GUI res and force the clear of the screen
- g_graphicsContext.SetVideoResolution(CDisplaySettings::GetInstance().GetCurrentResolution());
+ g_graphicsContext.SetVideoResolution(res);
return true;
}
@@ -2566,8 +2569,10 @@ void CApplication::OnApplicationMessage(ThreadMessage* pMsg)
}
break;
+#ifdef TARGET_ANDROID
case TMSG_DISPLAY_SETUP:
- *static_cast<bool*>(pMsg->lpVoid) = InitWindow();
+ // We might come from a refresh rate switch destroying the native window; use the context resolution
+ *static_cast<bool*>(pMsg->lpVoid) = InitWindow(g_graphicsContext.GetVideoResolution());
SetRenderGUI(true);
break;
@@ -2575,6 +2580,7 @@ void CApplication::OnApplicationMessage(ThreadMessage* pMsg)
*static_cast<bool*>(pMsg->lpVoid) = DestroyWindow();
SetRenderGUI(false);
break;
+#endif
case TMSG_SETPVRMANAGERSTATE:
if (pMsg->param1 != 0)
diff --git a/xbmc/Application.h b/xbmc/Application.h
index 58130a9ceb..2426795b18 100644
--- a/xbmc/Application.h
+++ b/xbmc/Application.h
@@ -24,6 +24,7 @@
#include "XBApplicationEx.h"
#include "guilib/IMsgTargetCallback.h"
+#include "guilib/Resolution.h"
#include "utils/GlobalsHandling.h"
#include "messaging/IMessageTarget.h"
@@ -144,7 +145,7 @@ public:
virtual bool Cleanup() override;
bool CreateGUI();
- bool InitWindow();
+ bool InitWindow(RESOLUTION res = RES_INVALID);
bool DestroyWindow();
void StartServices();
void StopServices();