Add canonical overlay-mode window support#195
Merged
Conversation
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
|
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.




Summary
MeltdownMonitor (and apps like it) implement an "overlay mode" — a borderless, always-on-top, translucent HUD — by reaching past
ImGuiAppand hand-styling the native window with their own P/Invoke (EnumThreadWindowsto find the handle, rawuser32calls to restyle it). This PR makes that a first-class, canonical feature ofImGui.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.IsOverlayActiveproperty.OverlayCornerenum.Native styling lives in an internal
OverlayChromeand usesImGuiApp'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*Ptrwindow-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 usesOverlayFpsand bypasses those reductions.Docs / demo / tests
ImGuiAppDemo: a View → Overlay mode toggle with opacity, click-through, and corner controls.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.csexcluded from the iOS target alongsideNativeMethods.cs, and no crefs to iOS-excluded types from files compiled on iOS.https://claude.ai/code/session_01Ngds45GjiRS3syR4uTrrvE
Generated by Claude Code