Repository navigation
fix(capture): keep the overlay out of scan captures; release idle HDR sessions - #78
Conversation
… sessions - Screen captures include layered windows (verified: GDI CopyFromScreen returns a topmost WS_EX_LAYERED window's pixels), so a tooltip still showing from the previous scan was read back into the next capture, drawn over the very item being re-scanned or its neighbours. The overlay window now uses WDA_EXCLUDEFROMCAPTURE (verified: the same probe then reads the pixels underneath; the running overlay reports affinity 0x11). ToolTip.ExcludeFromCapture in config.cfg (default on) turns this off for users who want tooltips in screenshots/streams. - Opt-in HDR capture kept its desktop-duplication sessions forever after the first scan; an active duplication makes DWM copy every frame. Sessions are now released after 30 s without an HDR capture. Claude-Session: https://claude.ai/code/session_01QFKiA2aswHyp8SnpraLxE2
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 16 minutes. View limit details
📝 Summary
Merge Risk: 🔵 Low · up to
|
ExcludeFromCapture keeps the overlay out of scans, but it also hides tooltips from OBS and screenshots, and it could only be changed by editing the config file. Add a General settings switch (all locales), and make the overlay re-apply the display affinity on the next tooltip when the setting changes. Claude-Session: https://claude.ai/code/session_01AJBRm45o94V3UvbN5ZbLUD
…ases - IdleRelease checks the deadline under the caller's lock, so a timer callback queued behind a capture re-arms instead of tearing down the session just used. - A failed SetWindowDisplayAffinity is no longer recorded as applied; the next tooltip retries and the warning is logged once per failure streak. - Tests cover the countdown restart, the queued-callback race, cancel, and the capture exclusion success, failure, and unsupported-OS paths. Claude-Session: https://claude.ai/code/session_01AJBRm45o94V3UvbN5ZbLUD
Why
CopyFromScreen(SourceCopy)returns the pixels of a topmostWS_EX_LAYEREDwindow. A tooltip still showing from the previous scan (1.5 s) is therefore read back into the next icon/name capture, drawn over the item being re-scanned or its neighbours. Plausible contributor to "inconsistent icon scans".Related: #34 (repeated icon scans returning the same item at 0.94 while different items were clicked is consistent with the previous tooltip being captured; EFT's own hover tooltip is a separate cause).
What
SetWindowDisplayAffinity(WDA_EXCLUDEFROMCAPTURE)(Win10 2004+; failure is logged and leaves today's behaviour).ToolTip.ExcludeFromCapture(default on) is a Settings → General switch, "Hide tooltips from screenshots and recordings", in all 7 locales. Changing it takes effect the next time a tooltip appears.IdleReleasehelper; HDR sessions are released after 30 s without an HDR capture and recreated on the next one.Validation
0x11affinity → background pixels captured.0x11, main window unchanged; clean exit.IdleReleaseTests(release after idle, countdown restarts on use, no release before use/after cancel), config default/disable test.dotnet test412/412 on this branch.Tooltip_capture_exclusion_can_be_turned_off_and_back_on_from_settingschecks that turning the setting off and back on updates the runtime value and saves it each time. The WebView2 smoke test checks that the switch is visible. All 7 locale files have the same 385 keys.EnableWindowsTargeting) for the app, unit test, and UI test projects with 0 errors, and CSharpier is clean. Tests were not run there because Linux has no WindowsDesktop runtime.IdleReleasetimer callback can still release sessions just after aTouch(). The only cost is one extra session rebuild on the next HDR capture.Decision for review
Not done (needs in-game evidence)
AlwaysOnTopdefault true, layered) over a fullscreen game: its cost lands in DWM/the game's flip model, which the idle benchmark cannot see. No change without a measurement.https://claude.ai/code/session_01QFKiA2aswHyp8SnpraLxE2
https://claude.ai/code/session_01AJBRm45o94V3UvbN5ZbLUD