-
Notifications
You must be signed in to change notification settings - Fork 7.6k
WIP - [MouseWithoutBorders] - incremental code cleanup / refactor #44553
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
WIP - [MouseWithoutBorders] - incremental code cleanup / refactor #44553
Conversation
|
@vanzue - I'm thinking about going through Mouse Without Borders and try to clean up some of the code in a series of focussed PRs like this one. From what I've been told, the original MWB code was ported like-for-like into PowerToys without any refactoring in order to avoid introducing any defects while it was being onboarded, but now that it's stable I figured it might be worth trying to do some light "modernising" to parts of it. I'm not sure if this sort of refactoring work is going to be useful though, or if it's just going to create a testing overhead for releases without adding any new features. My ultimate goal is to get to a point where I could implement this feature - #34126 - Integrate Mouse Jump with Mouse Without Borders to allow jumping to remote computers when MWB is enabled - but at the moment it would mean wrestling with some of the more complicated bits of the codebase. If I can simplify the existing code a bit first it might make that easier to do. If this PR isn't a good use of the team's time though I'm happy to scrap it and delete this PR. M |
|
Thanks for the context and for taking the time to explain the motivation behind this. |
|
There's a couple of merge conflicts that didn't resolve properly that are making wonky changes to CmdPal and FancyZones - I'll fix those shortly... |
84aed46 to
abb26b6
Compare
|
Update - wonky merge conflict fixed. |
Summary of the Pull Request
Some focussed refactoring / simplifying / cleanup / delinting on the Mouse Without Borders codebase (see #44508 - [Mouse Without Borders] - de-linting codebase) now that the Common class has been broken down.
This PR does some cleaning up on the
Loggerclass:var, etc)I've split the changes into lots of small commits - it might be easier to review the individual commits rather than the whole PR in one go.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
Run manual tests from Test Checklist Template:
Install PowerToys on two PCs in the same local network:
netsh advfirewall firewall add rule name="PowerToys.MouseWithoutBorders - mc" dir=in action=allow program="C:\src\mc\PowerToys\x64\Debug\PowerToys.exe" enable=yes remoteip=any profile=any protocol=tcpSetup Connection:
Verify Connection Status:
Test Remote Mouse/Keyboard Control:
Test Remote Control with Elevated Apps:
get-process -Name "PowerToys.MouseWithoutBorders*" -IncludeUserName | format-table Id, ProcessName, UserNamePowerToys.MouseWithoutBorders.exe- running asSYSTEMPowerToys.MouseWithoutBorders.Helper.exe- running as current userget-service -Name "PowerToys.*" | ft Status, Name, UserName; get-ciminstance -Class "Win32_Service" -Filter "Name like 'PowerToys%'" | ft ProcessId, NamePowerToys.MWB.Service- running asLocal SystemTest Module Enable Status:
Test Disconnection/Reconnection:
Test Various Local Network Conditions:
Clipboard Sharing:
Drag and Drop:
Lock and Unlock with "Use Service" Enabled:
Test Settings:
Group Policy Tests
See https://learn.microsoft.com/en-us/windows/powertoys/grouppolicy
[missing]- "Activation -> Enable Mouse Without Borders" enabled, with GPO warning hiddenreg delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\PowerToys /v ConfigureEnabledUtilityMouseWithoutBorders /f0- "Activation -> Enable Mouse Without Borders" set to "off" and disabled, with GPO warning visiblereg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\PowerToys /v ConfigureEnabledUtilityMouseWithoutBorders /t REG_DWORD /d 0 /f1- "Activation -> Enable Mouse Without Borders" set to "on" and disabled, with GPO warning visiblereg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\PowerToys /v ConfigureEnabledUtilityMouseWithoutBorders /t REG_DWORD /d 1 /f[missing]- "Advanced Settings -> IP address mapping" enabled, with GPO warning hiddenreg delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\PowerToys /v MwbDisableUserDefinedIpMappingRules /f0- "Advanced Settings -> IP address mapping" enabled, with GPO warning hiddenreg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\PowerToys /v MwbDisableUserDefinedIpMappingRules /t REG_DWORD /d 0 /f1- "Advanced Settings -> IP address mapping" disabled, with GPO warning visiblereg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\PowerToys /v MwbDisableUserDefinedIpMappingRules /t REG_DWORD /d 1 /f[missing]- "Advanced Settings -> IP address mapping" enabled, with GPO warning and GPO values hiddenreg delete HKEY_LOCAL_MACHINE\SOFTWARE\Policies\PowerToys /v MwbPolicyDefinedIpMappingRules /f[empty value]- "Advanced Settings -> IP address mapping" enabled, with GPO warning hidden and GPO values hiddenreg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\PowerToys /v MwbPolicyDefinedIpMappingRules /t REG_MULTI_SZ /d "" /f[non-empty value]- "Advanced Settings -> IP address mapping" enabled, with GPO warning visible and GPO values visiblereg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\PowerToys /v MwbPolicyDefinedIpMappingRules /t REG_MULTI_SZ /d "aaa 10.0.0.1\0bbb 10.0.0.2" /f