Skip to content

Replace tray restore cloak with transition cover - #1225

Closed
MarceloAlejandroJorquera wants to merge 1 commit into
Aleksoid1978:masterfrom
MarceloAlejandroJorquera:fix-tray-restore-no-cloak
Closed

Replace tray restore cloak with transition cover#1225
MarceloAlejandroJorquera wants to merge 1 commit into
Aleksoid1978:masterfrom
MarceloAlejandroJorquera:fix-tray-restore-no-cloak

Conversation

@MarceloAlejandroJorquera

Copy link
Copy Markdown

Summary

Replaces the DWMWA_CLOAK workaround used while restoring MPC-BE from the notification area with a temporary owned layered cover.

The existing restore fix rebuilds the frame/view layout after the hidden player is shown, repositions and repaints the renderer, and redraws the complete frame before presenting it. This prevents the white/unpainted client area that could previously appear when restoring from the tray.

The cloak was only being used to prevent DWM from presenting that intermediate restore state.

This change preserves the existing restore/layout fix while removing the cloak.

Implementation

On Windows 8 and later, tray restore now:

  • rebuilds the frame/view layout while the player is still hidden;
  • creates a temporary owned topmost layered cover over the player restore rectangle;
  • presents that independent cover before showing the real MPC-BE window;
  • shows the real player normally;
  • performs the existing final layout, renderer positioning, repaint and synchronous frame redraw;
  • waits for the completed real window to reach DWM;
  • removes the temporary cover.

The actual restore/layout sequence is otherwise unchanged.

The temporary surface is opaque black and does not capture or reproduce desktop content.

Reason

Keeping the real player cloaked during restore prevents an incomplete frame from being presented, but it also removes the player from DWM presentation while the restore is taking place.

The temporary layered cover provides the same presentation isolation without cloaking the MPC-BE HWND.

The real player can therefore remain normally visible to the window manager while its child layout and renderer destination are finalized behind the independent cover.

Testing

Tested locally with repeated notification-area hide/restore cycles using:

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

The previous white/unpainted restore-area fix remains effective, and restore works without DWMWA_CLOAK.

This change is limited to the notification-area restore path. Fullscreen transition handling is intentionally outside the scope of this PR.

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