Skip to content

feat(render): add a capture-visible liquid glass compatibility mode - #243

Merged
FoOcean merged 2 commits into
masterfrom
feat/liquid-glass-magnifier
Oct 16, 2026
Merged

FoOcean merged 2 commits into
masterfrom
feat/liquid-glass-magnifier

Conversation

@FoOcean

@FoOcean FoOcean commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Pre-submission checklist

  • I have read CONTRIBUTING.md and completed the required checks
  • Local and CI checks pass
  • I have completed a self-review
  • I confirm that I haven't read the checkboxes and just ticked them all

Change type (select one)

  • feat New feature
  • fix Bug fix
  • docs Documentation or templates
  • style Formatting with no behavior change
  • refactor Code change that neither fixes a bug nor adds a feature
  • perf Performance improvement
  • test Test-related change
  • chore Build, CI, dependency, or tooling change
  • revert Revert
  • security Security fix

Scope (select all that apply)

  • Application core
  • UI style or layout
  • Application behavior
  • Dependency changes
  • Plugin API
  • CI/CD configuration
  • Documentation
  • Other (describe below)

Related issues

  • None

Description

Summary

Adds an opt-in liquid glass "compatibility mode" that keeps the island visible in screenshots, recordings, and remote desktop, and fixes the settings window clipping after moving between monitors with different scaling.

Motivation and context

Liquid glass sets WDA_EXCLUDEFROMCAPTURE on the island so the monitor capture never samples the island itself. That makes the island disappear from screenshots, recordings, and remote desktop. Some users need the island to stay capturable, even at a small latency cost.

Separately, moving the settings window from a 150 % monitor to a 100 % one could leave the window at its old physical size while the content kept the new logical size. The panel was clipped to part of the window, could not reach the screen edges, and the sidebar blur spilled below it.

Changes

Liquid glass compatibility mode (liquid_glass_compat_capture, default off)

  • Default behaviour is unchanged: monitor capture plus WDA_EXCLUDEFROMCAPTURE.
  • With the option on, capture/magnifier.rs runs a Magnification control in a DWM-cloaked host window on its own thread. Its exclude filter list contains every top-level window of the WinIsland process. Windows.Graphics.Capture captures that host window (CreateForWindow) instead of the monitor, so the island needs no capture exclusion.
  • The magnifier source follows the overlay window rect and refreshes at the existing capture rate (60 Hz while animating, 30/20 Hz idle). The rest of the pipeline (shared texture, fences, change probe, frost blur, shader) is unchanged.
  • If the magnifier cannot start, capture falls back to the excluded monitor path and logs a warning.
  • WindowSystem::start_backdrop_capture takes a visible_to_capture flag. The app restarts capture when the setting changes at runtime.
  • Capture restarts now seed the write counter and serial from the shared fence's completed value. Previously a restart reused the renderer's fence with a counter reset to 0, so every D3D11 Signal failed with E_INVALIDARG and the glass fell back to a solid fill.
  • Settings: new toggle under the liquid glass options, with a hint that switches between the existing "hidden from capture" note and the compatibility-mode note (zh/en/es).

Settings window DPI fix

  • handle_resized retries a mismatched DPI resize once, then always adopts the real window size instead of returning early.
  • Each redraw resyncs the stored size and render target with the window's actual inner size. After a scale change, the window re-requests logical size × scale outside the DPI callback if the size did not follow.
  • The sidebar host-backdrop blur is clamped to the drawn panel.

Measurements (60 Hz, 15 s runs, same machine)

Monitor capture (default) Magnifier capture (compat)
Background change to captured frame, p50 / p90 11 / 18 ms 24 / 36 ms
Frames where an excluded window leaked in n/a 0 of ~850
Magnifier refresh thread CPU — ~1.8 %

Verified: both modes and runtime switching (window display affinity and the cloaked host window follow the setting), and the island appears in a GDI screenshot with glass in compat mode. Not verified: Windows 10, HDR, and dragging the settings window across monitors after this fix.

cargo fmt --check passes. MSVC clippy reports only two existing lints in files this PR does not touch (timer_view.rs manual_is_multiple_of, recorder.rs chunks_exact_to_as_chunks).

UI changes

Effects page, liquid glass options: new toggle "兼容模式(截图与录屏可见)" / "Compatibility mode (visible in captures)". Its hint reads "兼容模式下截图、录屏和远程桌面能灵动岛可见;但会增加背景延迟与CPU占用。" when on. The existing note that liquid glass hides the island from captures shows when it is off.

🤖 Generated with Claude Code

FoOcean and others added 2 commits October 16, 2026 09:41
Liquid glass keeps hiding the island from screen capture by default. The new
"liquid_glass_compat_capture" option instead samples the desktop through a
cloaked Magnification window that excludes WinIsland's own windows, so the
island stays visible in screenshots, recordings, and remote desktop at the
cost of about one frame of background latency and slightly more CPU. If the
magnifier cannot start, capture falls back to the excluded monitor path.

Capture restarts now continue from the shared fence's completed value, so
switching modes at runtime no longer fails every copy with E_INVALIDARG.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…anges

Moving the settings window between monitors with different scaling could
leave its physical size at the old scale while the content kept the new
logical size, so the panel was clipped, could not reach the screen edges,
and the sidebar blur spilled past it. The window now retries the DPI resize
once, adopts its real size on every redraw, and the sidebar blur is clamped
to the drawn panel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@FoOcean
FoOcean merged commit a71a651 into master Oct 16, 2026
2 of 3 checks passed
@github-project-automation github-project-automation Bot moved this from Needs Review to Merge in Winisland Pull Requests Oct 16, 2026
@FoOcean FoOcean mentioned this pull request Oct 16, 2026
5 of 22 tasks
@Eatgrapes
Eatgrapes deleted the feat/liquid-glass-magnifier branch October 16, 2026 15:04
@FoOcean FoOcean mentioned this pull request Oct 19, 2026
5 of 22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant