Skip to content

Fix overlay window stutter after focus changes#928

Open
oldreceipt wants to merge 1 commit into
Kvan7:devfrom
oldreceipt:feat/overlay-stutter-fix
Open

Fix overlay window stutter after focus changes#928
oldreceipt wants to merge 1 commit into
Kvan7:devfrom
oldreceipt:feat/overlay-stutter-fix

Conversation

@oldreceipt

Copy link
Copy Markdown

Summary

  • Hide the native overlay window when no overlay content is visible.
  • Re-sync overlay window visibility after focus events from electron-overlay-window.
  • Avoid keeping a global mousemove hook active during normal gameplay.
  • Forward dev-runner flags to Electron so diagnostics like --no-overlay work in dev.

Why

The transparent always-on-top Electron overlay can remain visible/click-through above the game after overlay focus changes. This can cause perceived frame pacing stutter even when FPS and 1% lows look fine. Alt-tabbing can temporarily clear it because it forces a fresh Windows focus/compositor transition.

Validation

  • main: npm run build
  • main: npm run lint
  • renderer: npm run build
  • renderer: npm run lint
  • Manual in-game testing showed the overlay-hidden path noticeably reduced stutter.

@Kvan7

Kvan7 commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Hey thanks for the PR! Could you explain the stuttering you were seeing and the type/method of testing that this is gone with this change? I'm not really seeing much stuttering, which is maybe just since I'm on a decent PC but I'll see if i can replicate the performance improvement
Also, if possible, could you describe how much LLM assistance was used when creating this PR?

@oldreceipt

Copy link
Copy Markdown
Author

Hard to describe precisely: while the app is running, PoE2 feels like it has bad frame pacing / bad 1% lows, but the FPS counters I checked did not show a meaningful drop. My system is a 7800X3D + 9070 XT, so this was not from being GPU/CPU bound.

The practical symptom was that Exiled Exchange became unusable during mapping for me: I would normally have to close the app before entering a map and restart it when I wanted to price check. With this patch, that behavior is gone in my manual testing.

Testing method was manual A/B testing:

  • run current app build, enter map, observe the frame pacing issue while the overlay app is running
  • close/restart or alt-tab to confirm the compositor/focus behavior changes the symptom
  • run patched build and repeat the same mapping/overlay open-close flow
  • verify the stutter no longer appears when no overlay content is visible

I do not have a synthetic benchmark that captures it well, since average FPS and 1% lows did not reflect the issue for me. My best guess is that this is related to the Windows compositor / transparent always-on-top Electron overlay staying in the presentation path, so it may depend on Windows version, GPU driver, display mode, or focus state.

On LLM assistance: I used Codex/GPT-5 as an engineering assistant for codebase discovery, debugging hypotheses, and drafting parts of the patch. I’m a professional software engineer, not submitting this as an unreviewed AI-generated change: I reproduced the issue locally, tested the fix manually in-game, reviewed the final diff, and removed unrelated changes before opening the PR.

@oldreceipt

Copy link
Copy Markdown
Author

Any updates on this?

@Kvan7

Kvan7 commented Jun 13, 2026

Copy link
Copy Markdown
Owner

I'll look at it at some point, I've got other things i'm doing right now though and I don't particularly look forward to reviewing llm generated code tbh

@oldreceipt

Copy link
Copy Markdown
Author

On topic:
Ask whatever you need about my setup - I just want ts to be usable again

Off-topic:
Look, I'll be straight with you.

You asked how much LLM assistance I used and I told you the truth.
I reviewed every line myself.

I could've just not mentioned it and you'd have reviewed a ~100 line diff on its merits. Me being honest is the only reason it's sitting here.

It's fine, it's your repo, reject whatever you want.
But be honest with yourself about what you're filtering on.

@Kvan7 Kvan7 changed the base branch from master to dev June 13, 2026 20:56
@Kvan7

Kvan7 commented Jun 14, 2026

Copy link
Copy Markdown
Owner

When using this I can see it gains about 10-20 fps when the game is active, and maybe less stutter when focusing the game from having the overlay active(with respect to no/less fps dip).

When trying to price check an item now, there is a flicker/fade in of the UI instead of it just appearing. From reviewing video of with/without the patch(below), it seems like the flicker portion was maybe swapped from the end to the start of price checking. Tried to debug why the flickering moved to the start for an hour or two but couldn't figure it out (following the code flow in overlay window was a pain the last time i looked at it so not super shocking). Personally would prefer the flicker at the end, even though it may effect gameplay more, since it makes the UI feel much snappier to use.

With PR:
https://github.com/user-attachments/assets/4a44effc-a228-49cc-9afc-84455e92960b

Without PR:
https://github.com/user-attachments/assets/05be8a1c-6e61-46a6-95ce-7557bf691288

@oldreceipt

Copy link
Copy Markdown
Author

Agree about the flickering...
It's the damn Windows Compositor
I'll look into it

@oldreceipt oldreceipt force-pushed the feat/overlay-stutter-fix branch from c386f60 to 0782a1c Compare June 16, 2026 01:07
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