Skip to content

fix(screenshot): force full-damage commit on cursor toggle - #3365

Merged
bbedward merged 2 commits into
duxlabs-dev:masterfrom
hthienloc:fix/screenshot-cursor-toggle-display
Sep 8, 2026
Merged

bbedward merged 2 commits into
duxlabs-dev:masterfrom
hthienloc:fix/screenshot-cursor-toggle-display

Conversation

@hthienloc

@hthienloc hthienloc commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

Fix #3364

@hthienloc

Copy link
Copy Markdown
Member Author

/claude review

@claude

claude Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Claude review

Fix in region.go is correct and minimal; the accompanying test is tautological.

  • Test asserts hardcoded literals instead of calling renderSurface, would pass with the fix reverted, core/internal/screenshot/region_key_test.go:36
    Checked: the v4 damage path — slot cache reuse after a double toggle leaves the committed buffer's cursor state stale, so forcing full damage on committedCursor mismatch addresses that; committedCursor is updated on every commit path (including phaseScroll and full redraws) and the early returns leave it consistent, so no stuck-full-damage or missed-update case. Model: claude-opus-5.

@hthienloc

Copy link
Copy Markdown
Member Author

/claude review

@claude

claude Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Claude review

No issues found.
Checked: the diff is now only the committedCursor fix in core/internal/screenshot/region.go — the tautological region_key_test.go test flagged in the previous run has been dropped, so that finding is resolved. Re-verified the v4 damage path: with the 3-slot ring, a double cursor toggle can land on a slot whose cached background already matches showCapturedCursor (cacheValid true) while the last committed buffer holds the other cursor state, so forcing full damage on os.committedCursor != r.showCapturedCursor is the right fix; committedCursor is written on every path that reaches Commit() (including phaseScroll), all early returns happen before any commit so it never goes stale, and slot recreation clears backgroundInitialized so a stale value cannot suppress a needed full damage. fullDamage still defaults to true for compositor version < 4. gofmt-clean.
Model: claude-opus-5.

@bbedward
bbedward merged commit 0f05846 into duxlabs-dev:master Sep 8, 2026
3 checks passed
bbedward pushed a commit that referenced this pull request Sep 8, 2026
* fix(screenshot): force full-damage commit on cursor toggle with compositor v4

* test(screenshot): drop tautological cursor-mismatch test

(cherry picked from commit 0f05846)
@hthienloc
hthienloc deleted the fix/screenshot-cursor-toggle-display branch November 15, 2026 15:38
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.

[BUG] Screenshot tool does not capture the mouse cursor position at the time the screenshot is taken

2 participants