aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Fedchin <anightik@gmail.com>2018-12-11 15:40:00 +0300
committerAnton Fedchin <anightik@gmail.com>2018-12-13 08:40:12 +0300
commita941a52f43eaf20940736d65037dc237eb270144 (patch)
tree77e45f2b696774a19a8bb6ab4da53fc669d884a0
parent6a77d66dae3f5ce9db78e46bf4f4f536d98dff74 (diff)
[win32] forcible change resolution (if required) on application starts
-rw-r--r--xbmc/windowing/windows/WinSystemWin32.cpp11
-rw-r--r--xbmc/windowing/windows/WinSystemWin32.h3
2 files changed, 7 insertions, 7 deletions
diff --git a/xbmc/windowing/windows/WinSystemWin32.cpp b/xbmc/windowing/windows/WinSystemWin32.cpp
index 83d9de1269..7b2ae0331c 100644
--- a/xbmc/windowing/windows/WinSystemWin32.cpp
+++ b/xbmc/windowing/windows/WinSystemWin32.cpp
@@ -441,11 +441,8 @@ bool CWinSystemWin32::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool
bool changeScreen = false; // display is changed
bool stereoChange = IsStereoEnabled() != (CServiceBroker::GetWinSystem()->GetGfxContext().GetStereoMode() == RENDER_STEREO_MODE_HARDWAREBASED);
- if ( m_nWidth != res.iWidth
- || m_nHeight != res.iHeight
- || m_fRefreshRate != res.fRefreshRate
- || oldMonitor->hMonitor != newMonitor->hMonitor
- || stereoChange)
+ if ( m_nWidth != res.iWidth || m_nHeight != res.iHeight || m_fRefreshRate != res.fRefreshRate ||
+ oldMonitor->hMonitor != newMonitor->hMonitor || stereoChange || m_bFirstResChange)
{
if (oldMonitor->hMonitor != newMonitor->hMonitor)
changeScreen = true;
@@ -458,7 +455,8 @@ bool CWinSystemWin32::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool
// entering to stereo mode, limit resolution to 1080p@23.976
if (stereoChange && !IsStereoEnabled() && res.iWidth > 1280)
{
- res = CDisplaySettings::GetInstance().GetResolutionInfo(CResolutionUtils::ChooseBestResolution(24.f / 1.001f, 1920, 1080, true));
+ res = CDisplaySettings::GetInstance().GetResolutionInfo(
+ CResolutionUtils::ChooseBestResolution(24.f / 1.001f, 1920, 1080, true));
}
if (m_state == WINDOW_STATE_WINDOWED)
@@ -490,6 +488,7 @@ bool CWinSystemWin32::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool
OnScreenChange(newMonitor->hMonitor);
}
+ m_bFirstResChange = false;
m_bFullScreen = fullScreen;
m_hMonitor = newMonitor->hMonitor;
m_nWidth = res.iWidth;
diff --git a/xbmc/windowing/windows/WinSystemWin32.h b/xbmc/windowing/windows/WinSystemWin32.h
index 5ee370ff35..39c218248d 100644
--- a/xbmc/windowing/windows/WinSystemWin32.h
+++ b/xbmc/windowing/windows/WinSystemWin32.h
@@ -185,7 +185,8 @@ protected:
DWORD m_windowExStyle; // the ex style of the window
bool m_inFocus;
bool m_bMinimized;
- bool m_bSizeMoveEnabled{ false };
+ bool m_bSizeMoveEnabled = false;
+ bool m_bFirstResChange = true;
std::unique_ptr<CIRServerSuite> m_irss;
std::vector<MONITOR_DETAILS> m_displays;
};