Skip to content

Replace fullscreen cloak with transition snapshot - #1224

Closed
MarceloAlejandroJorquera wants to merge 1 commit into
Aleksoid1978:masterfrom
MarceloAlejandroJorquera:fix-fullscreen-transition-no-cloak-pr
Closed

Replace fullscreen cloak with transition snapshot#1224
MarceloAlejandroJorquera wants to merge 1 commit into
Aleksoid1978:masterfrom
MarceloAlejandroJorquera:fix-fullscreen-transition-no-cloak-pr

Conversation

@MarceloAlejandroJorquera

Copy link
Copy Markdown

Summary

Replaces the DWMWA_CLOAK workaround used during fullscreen transitions with a temporary owned layered snapshot.

The previous fullscreen fix kept the main MPC-BE window logically visible while its layout was completed, preventing stale-frame and upper-left video quadrant artifacts. However, cloaking the real player window can expose the desktop or other windows underneath during the transition.

This change preserves the working fullscreen layout behavior without cloaking the player.

Implementation

On Windows 8 and later, the fullscreen transition now:

  • creates an owned topmost layered window covering the transition area;
  • captures only the currently visible MPC-BE window area;
  • leaves newly covered portions black instead of capturing background content;
  • submits the snapshot to DWM before changing the real player window;
  • keeps the real MPC-BE HWND logically visible so the existing MFC child layout runs normally;
  • uses the existing fullscreen style, positioning and MoveVideoWindow() path unchanged;
  • keeps the snapshot above the player until the final player geometry has reached DWM;
  • removes the snapshot after the transition is complete.

Windows 7 and earlier retain the existing path.

No separate renderer geometry or fullscreen video-sizing logic is introduced.

Reason

Hiding the real player window interferes with the normal child-window layout timing and can reproduce the upper-left video quadrant artifact.

DWMWA_CLOAK avoids that layout problem by keeping the HWND logically visible, but because the real window is removed from DWM presentation, content behind MPC-BE can become visible during the transition.

The temporary layered snapshot provides the required presentation isolation while allowing the real player window and its children to complete their normal layout.

Only the existing player area is captured. Any additional area required by the target fullscreen/windowed rectangle remains black, so desktop content outside MPC-BE is not captured into the transition surface.

Testing

Tested locally with repeated fullscreen/windowed transitions using:

  • active video playback;
  • paused video;
  • audio/static content;
  • empty player state.

The existing stale/corrupt-frame and upper-left video quadrant fixes remain effective, while the desktop/background exposure caused by fullscreen cloaking is avoided.

This change only replaces the cloak used by the fullscreen transition; unrelated uses of DWMWA_CLOAK elsewhere are intentionally outside the scope of this PR.

@Aleksoid1978

Copy link
Copy Markdown
Owner

It works, but now the transition process is taking longer on my 4K resolution.
I think I should abandon this idea and approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants