microsoft / PowerToys

Windows system utilities to maximize productivity
MIT License
108.36k stars 6.4k forks source link

Mouse Jump feature does not jump to second screen while using Mouse Without Borders. #33832

Open xloan opened 1 month ago

xloan commented 1 month ago

Microsoft PowerToys version

0.82.1

Installation method

Microsoft Store

Running as admin

Yes

Area(s) with issue?

Mouse Utilities, Mouse Without Borders

Steps to reproduce

I have two machines. Second machine has multiple monitors. I'm using the "Mouse Without Borders" feature and it is working great however I found a bug where I am on the second machine while using the "Mouse Jump" feature then I try to "jump" mouse cursor to another monitor, the mouse cursor goes back to the primary screen of the second machine when I try to move the mouse. I hope this ticket will solve in the next update. Thank you for this great software!

✔️ Expected Behavior

Mouse cursor stays on chosen monitor while using Mouse Without Borders.

❌ Actual Behavior

Mouse cursor jumps back to the primary screen of the second machine when moving mouse.

Other Software

No response

github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

mikeclayton commented 1 month ago

To confirm, I can reproduce the behaviour with Mouse Jump / MWB - it appears to be a duplicate of #30433.

PowerShell Repro

It can also be reproduced with just MWB and the following PowerShell-based steps:

Possible Cause

I think it's possibly because MWB isn't (currently) able to track when mouse utilities like Mouse Jump (and the above script) move the cursor to a new position via the Windows APIs, so it thinks any subsequent physical mouse movement is still relative to the "last know MWB position" and it snaps the cursor back to where it was before the jump.

You can see this if you don't move the mouse after clicking the Mouse Jump preview - the cursor will stay in the correct location until you move the mouse again - at that point MWB snaps it back to the "last known MWB position".

Related Issues

There've been a couple of semi-related issues with Mouse Jump and other mouse utilities in the past:

We fixed the issue with Mouse Crosshairs by making Mouse Jump call the SendInput api to update the mouse coordinates - Mouse Crosshairs listens for this event and updates the crosshair positions accordingly - a potential fix might be if MWB could listen for mouse move events from other utilities as well.