Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/apps/mplayerc/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11096,6 +11096,17 @@ void CMainFrame::ToggleFullscreen(bool fToNearest, bool fSwitchScreenResWhenHasT

m_bFullScreen = !m_bFullScreen;

// Keep the main HWND logically visible so the normal MFC/child layout runs
// during the fullscreen resize, but temporarily remove it from DWM
// presentation while its frame and geometry are being rewritten. Cloaking
// is Windows 8+, so Windows 7 and earlier retain the original code path.
bool bCloakedForFullscreenTransition = false;
if (SysVersion::IsWin8orLater() && IsWindowVisible()) {
const BOOL bCloak = TRUE;
bCloakedForFullscreenTransition = SUCCEEDED(DwmSetWindowAttribute(
m_hWnd, DWMWA_CLOAK, &bCloak, sizeof(bCloak)));
}

ModifyStyle(dwRemove, dwAdd, SWP_NOZORDER);

static bool bChangeMonitor = false;
Expand Down Expand Up @@ -11209,6 +11220,17 @@ void CMainFrame::ToggleFullscreen(bool fToNearest, bool fSwitchScreenResWhenHasT
m_bFullScreenChangingMode = false;
MoveVideoWindow();

// Reveal only after the final top-level and video-child geometry has been
// processed. Wait for the compositor to reach the transition's final
// presentation point first; unlike a forced RedrawWindow this does not
// synchronously repaint a stale pre-WM_SIZE child surface.
if (bCloakedForFullscreenTransition) {
DwmFlush();

const BOOL bCloak = FALSE;
DwmSetWindowAttribute(m_hWnd, DWMWA_CLOAK, &bCloak, sizeof(bCloak));
}

if (bChangeMonitor && (!m_bToggleShader || !m_bToggleShaderScreenSpace)) { // Enabled shader ...
SetShaders();
}
Expand Down