From a941a52f43eaf20940736d65037dc237eb270144 Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Tue, 11 Dec 2018 15:40:00 +0300 Subject: [win32] forcible change resolution (if required) on application starts --- xbmc/windowing/windows/WinSystemWin32.cpp | 11 +++++------ xbmc/windowing/windows/WinSystemWin32.h | 3 ++- 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 m_irss; std::vector m_displays; }; -- cgit v1.2.3