Skip to content

fix(ui): keep the docked window out while the pointer is on it - #74

Merged
coldhighsun merged 1 commit into
mainfrom
fix/edge-dock-pointer-over
Nov 11, 2026
Merged

coldhighsun merged 1 commit into
mainfrom
fix/edge-dock-pointer-over

Conversation

@coldhighsun

Copy link
Copy Markdown
Owner

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 saw false and 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

  • Add EdgeDockRules.ContainsPointer, a pure check of a pointer position against the window bounds with a 1 px margin.
  • Add 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.
  • Add unit tests for ContainsPointer, including edge values and negative coordinates (a screen left of the primary one).

Limitations

  • On Linux the system does not report the pointer position, so behavior there is unchanged (IsPointerOver only).
  • A topmost window covering part of the docked window keeps it open while the pointer is over that part.

Testing

  • dotnet build FluxTick.slnx
  • dotnet test --project tests/FluxTick.App.Tests --filter-class "*EdgeDock*"
  • Not reproduced by hand: the original problem is intermittent.

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

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coldhighsun
coldhighsun merged commit 5822bed into main Nov 11, 2026
7 of 8 checks passed
@coldhighsun
coldhighsun deleted the fix/edge-dock-pointer-over branch November 11, 2026 08:37
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.

1 participant