Repository navigation
fix(app): drag the splash by hand to avoid the hitch on release - #251
Merged
Merged
Conversation
Move the POINT/RECT structs used by WindowMaximizeHelper into a shared internal WindowNativeMethods class and add GetCursorPos, GetWindowRect, SetWindowPos and named SWP_* flags for other window code.
Window.DragMove runs the Win32 modal move loop, and the splash stuttered when the mouse button was released. Drag it with mouse capture instead: SplashDragTracker (pure, device pixels) computes the position and the window is moved with a single SetWindowPos per mouse event. A drag is re-anchored from the real window bounds when the window changes DPI, and a failed capture or bounds read does not leave the capture held.
Codecov Report❌ Patch coverage is
📢 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.
Summary
Window.DragMove, whose Win32 modal move loop is the suspected cause.SplashDragTracker(pure, device pixels) computes the position, and the window is moved with oneSetWindowPosper mouse event.LostMouseCaptureends the drag.POINT/RECT,GetCursorPos,GetWindowRect,SetWindowPos,SWP_*flags) move intoInfrastructure/WindowNativeMethods;WindowMaximizeHelpernow uses its structs. CLAUDE.md is updated for both.Not verified
SplashDragTrackerTestswere not compiled or run (NuGet restore of the test project failed locally). The app project builds with--no-restore.WindowMaximizeHelperrefactor) were not exercised.Test plan
dotnet test tests/ManagedDrive.Tests --filter "FullyQualifiedName~SplashDragTracker"