Add cursor dodge options for Always On Top#47235
Open
ozyours wants to merge 3 commits into
Open
Conversation
This comment has been minimized.
This comment has been minimized.
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new “Dodge cursor” behavior to the Always On Top module, including Settings UI controls and new module-side logic to animate pinned windows to a different screen corner when the cursor gets close.
Changes:
- Adds new Always On Top settings (enable, animation interval, corner padding) to the Settings UI model, XAML, and localized strings.
- Extends Always On Top module settings schema/loader to read the new JSON settings keys (with clamping).
- Implements a timer-driven cursor proximity check and window “dodge” animation logic in the Always On Top module.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/settings-ui/Settings.UI/ViewModels/AlwaysOnTopViewModel.cs | Adds view model properties backing cursor-dodge settings and clamps numeric inputs. |
| src/settings-ui/Settings.UI/Strings/en-us/Resources.resw | Adds localized strings for the new cursor-dodge settings UI. |
| src/settings-ui/Settings.UI/SettingsXAML/Views/AlwaysOnTopPage.xaml | Adds a SettingsExpander UI section for cursor-dodge toggles and numeric controls. |
| src/settings-ui/Settings.UI.Library/AlwaysOnTopProperties.cs | Adds default values and JSON property names for the new cursor-dodge settings. |
| src/modules/alwaysontop/AlwaysOnTop/SettingsConstants.h | Extends SettingId enum with cursor-dodge-related IDs for observer notifications. |
| src/modules/alwaysontop/AlwaysOnTop/Settings.h | Adds cursor-dodge settings fields to the module’s Settings struct. |
| src/modules/alwaysontop/AlwaysOnTop/Settings.cpp | Loads/clamps new cursor-dodge settings from JSON and notifies observers on changes. |
| src/modules/alwaysontop/AlwaysOnTop/AlwaysOnTop.h | Adds per-window state needed for dodge animation and new helper method declarations. |
| src/modules/alwaysontop/AlwaysOnTop/AlwaysOnTop.cpp | Implements timer setup, cursor polling, dodge scoring/selection, and animated window repositioning. |
…pliance - Fixes cursor dodge setting reactivity by observing CursorDodgeEnabled changes and routing them through SettingsUpdate. - Removes unconditional startup timer creation for cursor dodge; timer is now started/stopped based on enableCursorDodge. - Prevents a visual glitch when disabling cursor dodge mid-animation by finalizing active dodge animations to their target positions before clearing state. - Keeps border overlays aligned after forced animation finalization. - Marks local math helpers as constexpr (EaseOutCubic, Interpolate) to satisfy C++ analyzer rule C26497 under /WX. - Verified with module-only build: - AlwaysOnTop.vcxproj (Debug|x64) succeeds with 0 errors, 0 warnings.
This comment has been minimized.
This comment has been minimized.
Author
|
@microsoft-github-policy-service agree |
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 of the Pull Request
Adds a new Dodge Cursor feature to Always On Top.
This allows a pinned window to automatically move away when it blocks cursor interaction, making it easier to keep a window visible while still clicking content behind it.
PR Checklist
Detailed Description of the Pull Request / Additional comments
This PR introduces Dodge Cursor for Always On Top.
The feature is intended for scenarios where an always-on-top window is useful, such as watching a video while working, but can become intrusive when it blocks interaction with underlying content. With Dodge Cursor enabled, the pinned window automatically dodges the cursor instead of requiring the user to manually move or unpin it.
Validation Steps Performed