Repository navigation
feat(desktop): let the pointer through windows - #577
Merged
Merged
Conversation
Add desktop.SetWindowPointerEvents with WindowOptions.PointerEvents and PanelOptions.PointerEvents: WindowPointerNone lets every press, wheel turn and hover through a window to the windows below it, and WindowPointerPainted only where no view under the pointer draws something, hears the pointer or drags the window (driver.Painted). Code an Access holds needs AccessOverlay, as NSH's windows capability's overlay grants pointerEvents none. macOS sets ignoresMouseEvents, a painted window toggling it from a 60 Hz main run loop timer and the views' hit test; Windows makes the window layered and toggles WS_EX_TRANSPARENT, from a timer for a painted window; Linux sets the surface's input region, empty or the painted views' bounds, again in each frame after GTK set its own. Refs #568
…nter through, and teach the skill pointer events
houko
force-pushed
the
feat/window-pointer-events
branch
from
November 17, 2026 11:09
efc1c45 to
1c43bd5
Compare
5 of 7 tasks
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.
Summary
Fixes #568.
Desktop windows and panels can now let the pointer through to the windows below them.
desktop.SetWindowPointerEvents, withWindowOptions.PointerEventsandPanelOptions.PointerEventsfor the initial value. Switching modes at run time takes effect without reopening the window.WindowPointerNone: every press, wheel turn and hover goes through the window.WindowPointerPainted: the window takes the pointer only where a view under the pointer draws something, hears the pointer or drags the window (driver.Painted); elsewhere it goes through, the title bar the system draws included.AccessneedsAccessOverlay, as NSH'swindowscapability'soverlaygrantspointerEvents: none.Per platform:
ignoresMouseEvents; a painted window toggles it from a 60 Hz main run loop timer and the views' hit test.WS_EX_TRANSPARENT, from a timer for a painted window.Docs (architecture, public en/zh services), the
nsgoskill, the roadmap and the changelog are updated.Targets
core,internal/driver,desktop,nsgotest): tests run.The roadmap row records the hand acceptance check (a real press, wheel or hover reaching the window below) as remaining for macOS, Windows and Linux.
Screenshots
None: the change is pointer routing between windows and changes nothing that is drawn.
Verification
Implementation:
ubuild mise exec [email protected] -- go tool nsgo check -target linux_x64 && go tool nsgo check -target windows_x64: exit 0.rbuild mise exec [email protected] -- go tool nsgo check -target all: exit 0. Every target listed passed: macos, windows, linux (arm64 and x64), ios, tvos, watchos (device and simulator), android_arm64, web.ubuild mise exec [email protected] -- go tool nsgo teston./core(663 passed),./internal/driver(134 passed),./desktop(1 passed),./nsgotest(71 passed): all 0 failed.rbuild mise exec [email protected] -- go tool nsgo test ./internal/platform/macos -- -run 'TestWindowPointerEventsFollowTheMode|TestRefFocusUsesNativeKeyboardStops' -v: 2 passed.After review fixes:
ubuild mise exec [email protected] -- go tool nsgo check -target windows_x64,linux_x64: exit 0; catalogs and vet passed, plus vet for windows_x64 and linux_x64.system_native_test.go) was not run.gofmt -lreports nothing in the changed files.Second review (docs and skill only, no code change):
ubuild mise exec [email protected] -- go tool nsgo check -target all: exit 0 (every target but the Apple mobile ones, which need Xcode).ubuild mise exec [email protected] -- go tool nsgo teston./core(663 passed),./internal/driver(134),./nsgotest(71),./internal/moduletest(9,TestSkillsincluded),./desktop(1): 0 failed.rbuild mise exec [email protected] -- go tool nsgo test -run '^TestWindowPointerEventsFollowTheMode$' ./internal/platform/macos: passed.Not done: an acceptance check by hand on any OS.
Checklist
nsgoskill and roadmap updated.