Fix logo preview hidden under video on Windows (airspace problem)#10374
Merged
niksedk merged 1 commit intoSubtitleEdit:mainfrom Mar 23, 2026
Merged
Conversation
On Windows, mpv-wid and VLC use NativeControlHost which creates a Win32 HWND child window. HWNDs always render on top of Avalonia/Skia content, so the logo image overlay was invisible behind the native video window. Use software rendering (mpv-sw) in the logo preview dialog on Windows to avoid native window embedding. Falls back to the default player when mpv is not available or on non-Windows platforms. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
In the Burn-in Logo dialog (
Video → Burn-in subtitles → Logo tab → Preview), the logo overlay image is completely invisible — it renders behind the video surface and cannot be seen or positioned by the user.Affected platform: Windows only (Linux/macOS are not affected).
Affected players: mpv (wid mode) and VLC — both use Avalonia's
NativeControlHost, which embeds a Win32 HWND child window.Steps to reproduce
Root cause
On Windows,
NativeControlHostcreates a native Win32 HWND for the video surface. Native HWNDs always render on top of Avalonia/Skia-managed content regardless of z-order — this is the classic "airspace problem". As a result, any AvaloniaImageoverlay placed on top of the video is painted underneath the native window and becomes invisible.Fix
Introduce
InitVideoPlayer.MakeVideoPlayerPreferNonNative()which, on Windows, creates an mpv player using software rendering (LibMpvDynamicSoftwareControl) instead of the native-window-embedded variant. Software rendering draws into an AvaloniaWriteableBitmap, so the video and logo overlay share the same Avalonia render tree and z-order works correctly.On non-Windows platforms or when mpv is unavailable, the method falls back to the default
MakeVideoPlayer().Changed files
InitVideoPlayer.cs— new methodMakeVideoPlayerPreferNonNative()that prefers software rendering on Windows.BurnInLogoWindow.cs— uses the new method instead ofMakeVideoPlayer()for the logo preview.Before (logo hidden behind video):
After fix: