Repository navigation
fix(window): enforce one CaptionBarHitTest per window - #63
Merged
Merged
Conversation
Give each SaltWindow and SaltDialogWindow an independent registration slot so multiple caption hit-test regions cannot compete for the same window state. Reject a second active registration and release both the slot and hover state when the region leaves composition, allowing child windows and replacements to manage their own caption configuration. Document that CaptionBarHitTest only configures SaltUI window hit testing and does not provide standalone window movement. Explain the Popup scope boundary and why registration belongs in a DisposableEffect tied to window resources. Add real-window mouse and keyboard tests for duplicate registration, independent parent/child windows and dialogs, replacement, removal while hovered, and registration reuse. Check caption behavior inside, at, and outside the boundary. Validation on Windows: - CaptionBarHitTestTest: 4 passed. - SaltWindowTest: 8 passed. - WindowsCaptionBarTouchTest: 1 passed. - MainContentTest: 1 passed. - git diff --cached --check passed. Linux and macOS interactions were not run locally.
Check duplicate registrations by changing composition state in a real SaltUI window and awaiting its exception callback. Avoid native pointer injection for configuration-only assertions and restore the global exception configuration after each test so deferred errors cannot contaminate subsequent tests. Keep Robot coverage for native dragging. Wait for activation and actual input focus when switching windows, and wait for distinct semantics nodes after keyboard-driven replacement, removal, and re-registration instead of assuming an idle pass or a fixed activation delay delivered the input. Document overlapping animated branches and non-SaltUI child-window scopes in CaptionBarHitTest KDoc and diagnostics. Preserve the zero-or-one registration contract and the opt-in required by Window.findSkiaLayer(). Validation on Windows: - CaptionBarHitTestTest: all 4 tests passed in three consecutive class runs. - The combined regression run passed all 14 tests across CaptionBarHitTestTest, SaltWindowTest, WindowsCaptionBarTouchTest, and MainContentTest. - git diff --check passed. Linux and macOS interactions were not run locally.
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.
Multiple
CaptionBarHitTestinstances in one window share hit-test state and can interfere with one another. Give eachSaltWindowandSaltDialogWindowan independent registration slot: allow zero or one active region, reject duplicates, and release the slot and hover state on disposal so replacements and child windows work independently.Clarify that this API only configures SaltUI window hit testing and does not provide standalone window movement. Keep one configuration outside overlapping
AnimatedContent,Crossfade, orAnimatedVisibilitybranches. Only SaltUI windows create independent registration scopes; ComposePopup,Dialog,DialogWindow, and plainWindowchild content inherit their host's registration. Update the diagnostics to describe the SaltUI window scope explicitly.The configuration tests change state with
runOnIdlein real windows and await the host's exception callback, so they do not depend on pointer permissions or leak deferred failures into later tests. Native dragging remains covered by Robot input, with activation/focus checks and explicit semantics-node waits after keyboard-driven changes.Validation on Windows:
CaptionBarHitTestTest: all 4 tests passed in three consecutive full-class runs, then passed again in the combined regression run. Covers duplicate registration in a window and child dialog, independent parent/child dragging, replacement, removal while hovered, re-registration, and points inside, at, and outside the caption boundary.SaltWindowTest: 8 passed.WindowsCaptionBarTouchTest: 1 passed, including native touch dragging.MainContentTest: 1 passed.git diff --checkpassed.Linux and macOS interactions were not run locally.