Skip to content

Overlay: fixed-size, non-activating, shown only while Elite is in front (#204) - #209

Merged
demortes merged 1 commit into
mainfrom
fix/overlay-focus-204
Oct 9, 2026
Merged

demortes merged 1 commit into
mainfrom
fix/overlay-focus-204

Conversation

@demortes

@demortes demortes commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #204 (the overlay minimising/unfocusing the game and interfering with EDCopilot on a system jump).

What changed

The overlay was a topmost, self-resizing, always-on-top window over every app. On a jump its content changed shape, which was a native resize of a topmost window; it was never marked non-activating; and it sat over EDCopilot all the time. Now:

  1. The window never resizes. OverlayWindow has a fixed size (360x330); the visible panel is the inner Border, which grows and shrinks inside the transparent, click-through window. A jump no longer changes the native window.
  2. Updates only when something changed. OverlayContent.SameAs compares snapshots by value (the shortfall list was compared by reference, so every tick looked "changed"); WindowsOverlay.Update skips identical snapshots, so an idle overlay touches nothing, and the shortfall list is no longer rebuilt every 250 ms.
  3. WS_EX_NOACTIVATE added to the window styles (alongside layered/transparent/toolwindow), so it can never become the active window. If it is ever activated anyway, a trace line says so.
  4. Shown only while Elite is in front (OverlayVisibilityPolicy): visible when the foreground process is EliteDangerous64 (or EDNexus itself, so the Settings preview works), hidden otherwise, so it no longer sits over EDCopilot or any other app. Unknown foreground fails open. Foreground is polled every 750 ms and the window is shown/hidden only on a change.
  5. New setting Overlay.OnlyWhenGameFocused (default on) with a checkbox in Settings -> Overlay & Voice to keep the old always-on-top behaviour. Show/hide transitions are traced for diagnostics.
  6. Voice: a note under the callout list points to the known-mining-spots arrival callout (set under Mining), which was easy to miss.

Behaviour change to know about

By default the overlay now disappears when another app is in front (e.g. a browser, EDCopilot) and returns when Elite is. Anyone who wants it on a second monitor while Elite is not focused should untick "Only show while Elite Dangerous is in front".

Verified

dotnet build 0 warnings; full dotnet test green, with new tests for the visibility rule (game/own process/other apps/unknown/off, case and .exe handling) and for snapshot equality (separately built identical snapshots are the same; any visible change is not).

Not verified (needs a person)

I cannot run the overlay or the game here (and a locally built app auto-installs the latest release). Manual test needed with EDCopilot and Elite running: overlay on, several jumps with a plotted route and a colonisation shortfall: confirm nothing minimises, no window loses focus, and the overlay appears only with Elite in front. Also try Elite in exclusive fullscreen vs borderless. If problems persist, the new trace lines (Overlay: shown/hidden, Overlay: the overlay window was activated) in the app log will show what happened.

The fixed window size (360x330) is a first estimate large enough for five shortfall lines and two bio lines; if text is ever clipped on a long system name it can be raised.

🤖 Generated with Claude Code

…nt (#204)

The overlay was a topmost, self-resizing window over every app: each jump resized it, it was never marked
non-activating, and it sat over EDCopilot permanently. It now has a fixed window size, updates only when the
snapshot changed, is WS_EX_NOACTIVATE, and by default is visible only while Elite Dangerous (or EDNexus) is
the foreground app (setting Overlay.OnlyWhenGameFocused, on by default).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 36 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bf4d9809-6631-4f38-9fc3-60094435d927
📥 Commits

Reviewing files that changed from the base of the PR and between 8d05f19 and 5ac0d0a.

📒 Files selected for processing (11)
  • src/EDNexus.App/Bootstrap.cs
  • src/EDNexus.App/Services/Overlay/WindowsOverlay.cs
  • src/EDNexus.App/Views/OverlayWindow.axaml
  • src/EDNexus.App/Views/SettingsWindow.axaml
  • src/EDNexus.App/Views/SettingsWindow.axaml.cs
  • src/EDNexus.Core/Overlay/IOverlay.cs
  • src/EDNexus.Core/Overlay/NullOverlay.cs
  • src/EDNexus.Core/Overlay/OverlayModels.cs
  • src/EDNexus.Core/Overlay/OverlayVisibilityPolicy.cs
  • src/EDNexus.Core/Settings/AppSettings.cs
  • tests/EDNexus.Tests/Overlay/OverlayVisibilityTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@demortes
demortes merged commit 2ce5caf into main Oct 9, 2026
2 checks passed
@demortes
demortes deleted the fix/overlay-focus-204 branch October 9, 2026 05:31
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.

Overlay: topmost self-resizing window can minimize/steal focus from the game and EDCopilot on system jump

1 participant