Repository navigation
fix(ui): keep the docked window out while the pointer is on it - #74
Merged
Merged
Conversation
The edge-dock hide decision relied only on IsPointerOver, which stays false after a menu, flyout or drag took the pointer until the pointer moves again. The window then slid away under a stationary pointer. Where the system reports the pointer position, also check it against the window bounds.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Problem
A window docked to a screen edge sometimes slid back to its edge while the pointer was still on it.
The hide decision relied only on
IsPointerOver, which is updated by pointer enter/exit events. After a context menu, flyout or drag took the pointer, the window is told the pointer left and is never told it is back while the pointer stays still. The next leave check then sawfalseand hid the window under the pointer. The same stale state affected the checks that run after a tool window closes, a drag ends, the window is resized, or the screens change.Change
EdgeDockRules.ContainsPointer, a pure check of a pointer position against the window bounds with a 1 px margin.MainWindow.IsPointerOnWindow():IsPointerOver, or the system pointer position (TrayCursor.TryGetPosition) inside the window bounds. Use it in the leave check, the resume check, the settle check and the held-slide recheck.ContainsPointer, including edge values and negative coordinates (a screen left of the primary one).Limitations
IsPointerOveronly).Testing
dotnet build FluxTick.slnxdotnet test --project tests/FluxTick.App.Tests --filter-class "*EdgeDock*"