From d6d1518dc30ef79eed95492a601c87322822375b Mon Sep 17 00:00:00 2001 From: Anton Fedchin Date: Wed, 30 Jan 2019 21:10:32 +0300 Subject: [xbmc] application: handle resize event even in full screen state on windows. --- xbmc/Application.cpp | 12 ++++++++++++ xbmc/windowing/windows/WinEventsWin32.cpp | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index 2dc0989ded..a8ff2ceb10 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -278,6 +278,18 @@ void CApplication::HandlePortEvents() settings->SetInt(CSettings::SETTING_WINDOW_HEIGHT, newEvent.resize.h); settings->Save(); } +#ifdef TARGET_WINDOWS + else + { + // this may occurs when OS tries to resize application window + //CDisplaySettings::GetInstance().SetCurrentResolution(RES_DESKTOP, true); + //auto& gfxContext = CServiceBroker::GetWinSystem()->GetGfxContext(); + //gfxContext.SetVideoResolution(gfxContext.GetVideoResolution(), true); + // try to resize window back to it's full screen size + auto& res_info = CDisplaySettings::GetInstance().GetResolutionInfo(RES_DESKTOP); + CServiceBroker::GetWinSystem()->ResizeWindow(res_info.iScreenWidth, res_info.iScreenHeight, 0, 0); + } +#endif } break; case XBMC_VIDEOMOVE: diff --git a/xbmc/windowing/windows/WinEventsWin32.cpp b/xbmc/windowing/windows/WinEventsWin32.cpp index 4f03e3d62e..27262ab423 100644 --- a/xbmc/windowing/windows/WinEventsWin32.cpp +++ b/xbmc/windowing/windows/WinEventsWin32.cpp @@ -556,7 +556,7 @@ LRESULT CALLBACK CWinEventsWin32::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, L return(0); } case WM_DISPLAYCHANGE: - CLog::LogF(LOGDEBUG, "display change event"); + CLog::LogFC(LOGDEBUG, LOGWINDOWING, "display change event"); if (g_application.GetRenderGUI() && !DX::Windowing()->IsAlteringWindow() && GET_X_LPARAM(lParam) > 0 && GET_Y_LPARAM(lParam) > 0) { DX::Windowing()->UpdateResolutions(); -- cgit v1.2.3