aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp1
-rw-r--r--xbmc/windowing/win10/WinSystemWin10.cpp15
-rw-r--r--xbmc/windowing/win10/WinSystemWin10.h1
-rw-r--r--xbmc/windowing/win10/WinSystemWin10DX.cpp3
-rw-r--r--xbmc/windowing/windows/WinSystemWin32.cpp11
-rw-r--r--xbmc/windowing/windows/WinSystemWin32.h3
6 files changed, 16 insertions, 18 deletions
diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp
index 7fdafe2f2d..a85da3735b 100644
--- a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp
+++ b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderBuffer.cpp
@@ -85,6 +85,7 @@ void CRenderBuffer::Release()
m_activePlanes = 0;
texBits = 8;
bits = 8;
+ m_locked = false;
m_planes[0] = nullptr;
m_planes[1] = nullptr;
diff --git a/xbmc/windowing/win10/WinSystemWin10.cpp b/xbmc/windowing/win10/WinSystemWin10.cpp
index d2e2e8d90e..0ca1b684c9 100644
--- a/xbmc/windowing/win10/WinSystemWin10.cpp
+++ b/xbmc/windowing/win10/WinSystemWin10.cpp
@@ -119,11 +119,6 @@ bool CWinSystemWin10::CreateNewWindow(const std::string& name, bool fullScreen,
// and hide UWP splash, without this the Kodi's splash will not be shown
m_coreWindow.Dispatcher().ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);
- // in some cases CoreWindow::SizeChanged isn't fired
- // it causes mismatch between window actual size and UI
- winrt::Rect winRect = m_coreWindow.Bounds();
- dynamic_cast<CWinEventsWin10&>(*m_winEvents).OnResize(winRect.Width, winRect.Height);
-
return true;
}
@@ -209,10 +204,8 @@ bool CWinSystemWin10::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool
bool forceChange = false; // resolution/display is changed but window state isn't 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
- || stereoChange)
+ if ( m_nWidth != res.iWidth || m_nHeight != res.iHeight || m_fRefreshRate != res.fRefreshRate ||
+ stereoChange || m_bFirstResChange)
{
forceChange = true;
}
@@ -239,6 +232,7 @@ bool CWinSystemWin10::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool
m_IsAlteringWindow = true;
ReleaseBackBuffer();
+ m_bFirstResChange = false;
m_bFullScreen = fullScreen;
m_nWidth = res.iWidth;
m_nHeight = res.iHeight;
@@ -348,6 +342,9 @@ bool CWinSystemWin10::ChangeResolution(const RESOLUTION_INFO& res, bool forceCha
// changing display mode doesn't fire CoreWindow::SizeChanged event
if (changed && m_bWindowCreated)
{
+ // dispatch all events currently pending in the queue to change window's content
+ m_coreWindow.Dispatcher().ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);
+
float dpi = DisplayInformation::GetForCurrentView().LogicalDpi();
float dipsW = DX::ConvertPixelsToDips(m_nWidth, dpi);
float dipsH = DX::ConvertPixelsToDips(m_nHeight, dpi);
diff --git a/xbmc/windowing/win10/WinSystemWin10.h b/xbmc/windowing/win10/WinSystemWin10.h
index af3d7d3631..7e99e7e23c 100644
--- a/xbmc/windowing/win10/WinSystemWin10.h
+++ b/xbmc/windowing/win10/WinSystemWin10.h
@@ -143,6 +143,7 @@ protected:
WINDOW_WINDOW_STATE m_windowState; // the state of the window when in windowed
bool m_inFocus;
bool m_bMinimized;
+ bool m_bFirstResChange = true;
winrt::Windows::UI::Core::CoreWindow m_coreWindow = nullptr;
};
diff --git a/xbmc/windowing/win10/WinSystemWin10DX.cpp b/xbmc/windowing/win10/WinSystemWin10DX.cpp
index 928e57a4d0..2ac39b1d81 100644
--- a/xbmc/windowing/win10/WinSystemWin10DX.cpp
+++ b/xbmc/windowing/win10/WinSystemWin10DX.cpp
@@ -52,8 +52,7 @@ bool CWinSystemWin10DX::CreateNewWindow(const std::string& name, bool fullScreen
if (CWinSystemWin10::CreateNewWindow(name, fullScreen, res) && m_deviceResources->HasValidDevice())
{
CGenericTouchInputHandler::GetInstance().RegisterHandler(&CGenericTouchActionHandler::GetInstance());
- CGenericTouchInputHandler::GetInstance().SetScreenDPI(DX::DisplayMetrics::Dpi100);
- ChangeResolution(res, true);
+ CGenericTouchInputHandler::GetInstance().SetScreenDPI(m_deviceResources->GetDpi());
return true;
}
return false;
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;
};