Skip to content

Fix logo preview hidden under video on Windows (airspace problem)#10374

Merged
niksedk merged 1 commit intoSubtitleEdit:mainfrom
Ironship:fix-logo-preview-windows-zorder
Mar 23, 2026
Merged

Fix logo preview hidden under video on Windows (airspace problem)#10374
niksedk merged 1 commit intoSubtitleEdit:mainfrom
Ironship:fix-logo-preview-windows-zorder

Conversation

@Ironship
Copy link
Copy Markdown
Contributor

@Ironship Ironship commented Mar 22, 2026

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

  1. Open Subtitle Edit on Windows with mpv or VLC as the video player.
  2. Load a video and go to Video → Burn-in subtitles.
  3. Switch to the Logo tab and select a logo image.
  4. Click Preview — the logo overlay is invisible (hidden behind the video).

Root cause

On Windows, NativeControlHost creates 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 Avalonia Image overlay 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 Avalonia WriteableBitmap, 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 method MakeVideoPlayerPreferNonNative() that prefers software rendering on Windows.
  • BurnInLogoWindow.cs — uses the new method instead of MakeVideoPlayer() for the logo preview.

Before (logo hidden behind video):

qfeF0DxDTH

After fix:

{5F4790F6-17A8-4D36-8EFC-7868DBB88B05}

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>
@niksedk niksedk merged commit 578a353 into SubtitleEdit:main Mar 23, 2026
1 check passed
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