Skip to content

Add canonical overlay-mode window support#195

Merged
matt-edmondson merged 2 commits into
mainfrom
claude/gracious-keller-2D6Fe
May 31, 2026
Merged

Add canonical overlay-mode window support#195
matt-edmondson merged 2 commits into
mainfrom
claude/gracious-keller-2D6Fe

Conversation

@matt-edmondson
Copy link
Copy Markdown
Contributor

Summary

MeltdownMonitor (and apps like it) implement an "overlay mode" — a borderless, always-on-top, translucent HUD — by reaching past ImGuiApp and hand-styling the native window with their own P/Invoke (EnumThreadWindows to find the handle, raw user32 calls to restyle it). This PR makes that a first-class, canonical feature of ImGui.App, so consumers get always-on-top / borderless / translucency / click-through / corner-locking out of the box and never need their own native hacks.

What's new

Overlay API (ImGuiApp)

  • EnableOverlay(float opacity = 1.0f, bool clickThrough = false) — enter overlay mode: borderless, always-on-top, whole-window translucent, optional click-through. Cheap to call every frame (the native window is only restyled when something actually changes).
  • SetOverlayGeometry(OverlayCorner corner, int offsetX, int offsetY, int width, int height) — lock the overlay to a corner of the active monitor's work area.
  • DisableOverlay() — restore the decorated, non-topmost, opaque window.
  • IsOverlayActive property.
  • New public OverlayCorner enum.

Native styling lives in an internal OverlayChrome and uses ImGuiApp's own native handle (window.Native.Win32.Hwnd) rather than enumerating thread windows. It's implemented on Windows and degrades gracefully (no-op) on other platforms and on backends that don't export the *Ptr window-style APIs, while still tracking the logical overlay state.

Frame limiting "in context" with overlay

  • ImGuiAppPerformanceSettings.OverlayFps (default 30) — an always-on-top overlay is usually unfocused (and some backends report it as not visible), so the normal focus/idle/visibility throttling would make it sluggish despite showing live data. While overlay mode is active, the frame limiter uses OverlayFps and bypasses those reductions.

Docs / demo / tests

  • README: new "Overlay Mode" usage section and API-table entries.
  • ImGuiAppDemo: a View → Overlay mode toggle with opacity, click-through, and corner controls.
  • Tests for the overlay logical-state toggle, OverlayFps-driven frame limiting, idle-bypass, and safe no-op calls.

Compatibility

Purely additive — no existing API changed. Tagged [minor] (2.5.1 → 2.6.0).

Testing

The .NET 10 SDK could not be installed in this environment (all SDK download hosts return HTTP 403 under the network policy; only NuGet is reachable), so the build/tests were not run locally and rely on CI. The changes were written to compile cleanly: platform-guarded native calls (OperatingSystem.IsWindows()), OverlayWindow.cs excluded from the iOS target alongside NativeMethods.cs, and no crefs to iOS-excluded types from files compiled on iOS.

https://claude.ai/code/session_01Ngds45GjiRS3syR4uTrrvE


Generated by Claude Code

Add first-class support for "overlay" windows — borderless, always-on-top,
whole-window translucent, with optional click-through and corner-locked
geometry — so apps no longer need their own native window-styling hacks.

- ImGuiApp.EnableOverlay / SetOverlayGeometry / DisableOverlay + IsOverlayActive
- OverlayChrome: native Win32 styling via the app's own handle; safe no-op on
  other platforms and on backends missing the *Ptr style APIs, while still
  tracking logical overlay state
- New OverlayCorner enum for work-area corner anchoring
- ImGuiAppPerformanceSettings.OverlayFps: a dedicated overlay frame rate that
  bypasses focus/idle/visibility throttling (an always-on-top overlay is
  usually unfocused yet shows live data)
- Demo, tests, and README documentation

https://claude.ai/code/session_01Ngds45GjiRS3syR4uTrrvE
Reorder OverlayFps ahead of IdleTimeoutSeconds so the explanatory comments no
longer immediately follow a line ending in a trailing inline comment, which
dotnet format's trivia attachment flagged (IDE0055).

https://claude.ai/code/session_01Ngds45GjiRS3syR4uTrrvE
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
11 Security Hotspots
23.6% Coverage on New Code (required ≥ 80%)
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@matt-edmondson matt-edmondson merged commit e2a9c62 into main May 31, 2026
5 of 6 checks passed
@matt-edmondson matt-edmondson deleted the claude/gracious-keller-2D6Fe branch May 31, 2026 01:59
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