microsoft / microsoft/PowerToys

[Mouse Jump] - performance, reliability, maintainability improvements

Open
#50,464 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs-Triage Product-Mouse Jump
Dominant language
C
Stars
139k
Forks
8.6k
PR merge metrics
PR metrics pending

Description

### Description of the new feature / enhancement

Incorporate a number of reliability, performance, and maintainability improvements from the upstream FancyMouse codebase. This includes rendering optimizations, architectural cleanup, UI refactoring, bug fixes, and code quality enhancements, with no intended changes to core user-facing functionality.

Changes in the upstream are:

* **WinUI3 Controls** - the previous UI contained the entire preview window visualisation within a single rendered bitmap image. This is replaced with a structured hierarchy of WinUI3 controls (e.g. each background image, bezel and screensho) is a separate WinUI control, allowing for future effects like a highlight or emphasis effect on the screenshot the mouse is currently hovering over.

* **Parallel Capture** - add a "screen capture" pipeline that captures screenshots in parallel rather than one-at-a-time - significantly reduces wait time for screenshots to complete on multi-monitor systems

* **Progressive Screenshots** - background screen capture - if any screenshots take longer than 250ms to load, the preview form shows a blurred version of the *previous* screenshot instead. The blurred image is cross-faded into the actual screenshot for that screen once it's available. This reduces the "flashing" effect of the existing approach that shows a blank coloured "background" rectangle that transitions immediately to the latest screenshot. In most cases the screen is unlikely to have changed significantly (except for e.g. streaming video) so the blurred image presents an early low-fidelity visualisation of the screen while the actual capture is being completed.

* **Cancellation** - added cancellation tokens to cancel screen capture and rendering if the activation hotkey is pressed repeatedly. Previously an activation would run to completion and show the form briefly before closing and servicing the next activation - it now cancels the previous activation and starts the next one mmediately.

* **Opt-In Telemetry** - added a **local file-based logging** telemetry function that is **off** by default (can be enabled manually in the config file). This drops out structured events with performance timings onto the local file system and can be used as an additional information source to diagnose issues that can't be easily diagnosed from the log file alone. **Does not automatically ship telemetry logs anywhere when enabled - only persists to disk**

* **PInvoke Rewrite** - hand-written ```DllImport``` and ```LibraryImport``` methods replaced with CsWin32 for better standardisation

* **Maintenance** - lots code quality improvements - general refactoring, disposing GDI resources properly, removing dead code, adding / improving / rewording xmldocs and comments, tweaks, nips and tucks

### Scenario when this would be used?

Improves performance for all users.

### Supporting information

_No response_

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the Mouse Jump implementation with the upstream FancyMouse codebase and trace the existing preview rendering and screen-capture paths. The listed changes cover WinUI3 controls, parallel and progressive screenshots, cancellation, local telemetry, CsWin32 P/Invoke, and cleanup; done means incorporating these improvements while preserving core user-facing functionality.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.