Repository navigation
Conversation
- Add darwin_test.go, wayland_test.go - Update darwin.go and 5 others Generated with Codg Assisted-by: claude-fable-5-1 via Codg <codg@atomai.cc>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Session lifecycle races and incorrect click/drag state handling can leak hooks or emit inaccurate events.
Review effort: Balanced
Findings: 4
Open (7)
Global flag and delayed teardown allow stale tap to corrupt new session · New Data race and stale Wayland loop can overwrite new session · New Unsynchronized flag and stale hook thread can overwrite active session · New Unsynchronized session flag allows stale X11 loop to overwrite new session · New Darwin click detection misclassifies returned drags and unmatched releases · New MouseUp emitted for returned drags and unmatched releases · New Coordinate equality misclassifies drags and unmatched releases as clicks · New
What changed in this PR
Improves parity and lifecycle behavior across pure-Go platform backends.
Changes:
- Corrects mouse release, click, drag, wheel, and button mappings.
- Improves backend teardown handling.
- Adds platform-specific regression tests.
| File | Description |
|---|---|
darwin.go |
Updates Quartz event handling and lifecycle. |
darwin_test.go |
Adds Darwin regression tests. |
wayland.go |
Improves teardown and mouse events. |
wayland_test.go |
Adds Wayland mapping tests. |
windows.go |
Fixes hook startup and callback types. |
windows_test.go |
Tests wheel and button releases. |
x11.go |
Adds teardown ownership and mouse parity. |
x11_test.go |
Expands X11 event tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // so an End() that ran before this point is not missed. | ||
| lck.Lock() | ||
| mac = &darwinState{tapPort: port, source: source, runLoop: runLoop} | ||
| live := asyncon |
| // so an End() that ran before this point is not missed. | ||
| lck.Lock() | ||
| wl = st | ||
| live := asyncon |
| // hooks would stay installed on a thread nobody ever posts WM_QUIT to). | ||
| lck.Lock() | ||
| win = &winState{keyboardHook: kbHook, mouseHook: msHook, threadID: uint32(tid)} | ||
| live := asyncon |
| // so an End() that ran before this point is not missed. | ||
| lck.Lock() | ||
| xst = st | ||
| live := asyncon |
| lck.Lock() | ||
| st := mac | ||
| lck.Unlock() | ||
| if st == nil || st.pressX != released.X || st.pressY != released.Y { |
Comment on lines
+308
to
+311
| if press { | ||
| st.pressX, st.pressY = x, y | ||
| } | ||
| clicked := !press && st.pressX == x && st.pressY == y |
Comment on lines
+467
to
+471
| lck.Lock() | ||
| if press { | ||
| st.pressX, st.pressY = x, y | ||
| } | ||
| clicked := !press && st.pressX == x && st.pressY == y |
- Update windows.go, windows_test.go Generated with Codg Assisted-by: claude-opus-5-5 via Codg <codg@atomai.cc>
- Add session.go, session_test.go - Update darwin.go and 8 others Generated with Codg Assisted-by: claude-opus-5-5 via Codg <codg@atomai.cc>
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.


Generated with Codg
Assisted-by: claude-fable-5-1 via Codg codg@atomai.cc
Please provide Issues links to:
Provide test code:
Description
...