-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Ready for Review - [Mouse Without Borders] - refactoring "Common" classes (Part 4) - #35155 #37579
base: main
Are you sure you want to change the base?
Ready for Review - [Mouse Without Borders] - refactoring "Common" classes (Part 4) - #35155 #37579
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 26 out of 26 changed files in this pull request and generated 1 comment.
internal static void StartMouseWithoutBordersService(string desktopToRunMouseWithoutBordersOn = null, string startTag1 = "byapp", string startTag2 = null) | ||
{ | ||
// NOTE(@yuyoyuppe): the new flow assumes we run both mwb processes directly from the svc. | ||
if (Common.RunWithNoAdminRight || true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of '|| true' in the conditional always evaluates to true, bypassing the intended service start logic. Consider removing '|| true' or revising the condition to properly control service startup.
if (Common.RunWithNoAdminRight || true) | |
if (Common.RunWithNoAdminRight) |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (Common.RunWithNoAdminRight || true)
was in the original Common.Service.cs
file - Copilot's detected it as it thinks Service.cs
is a new file rather than a rename and is treating this as a "new" issue. I'd suggest leaving as-is for this PR.
Hi @mikeclayton , |
@jaimecbernardo - I didn't request the review as I've not properly worked through the tests yet, but it compiles locally and superficially appears to work. Happy to follow your lead though - I don't mind if you want to wait until I've finished testing before starting the review process. I already pushed one set of changes (#36950) into the next release (v0.89.0), so might be better to defer this PR until the release after to avoid too much churn? |
@jaimecbernardo - I've worked through most of the tests and it all seems to work, so I think this PR is ready for review now... |
Summary of the Pull Request
Part 4 of a slow-running refactor of the giant "Common" class in Mouse Without Borders into individual classes with tighter private scope.
Common.Event.cs
->Event.cs
Common.Helper.cs
->Helper.cs
Common.Launch.cs
->Launch.cs
Common.Service.cs
->Service.cs
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:
Setup 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, UserName
PowerToys.MouseWithoutBorders.exe
- running asSYSTEM
PowerToys.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, Name
PowerToys.MWB.Service
- running asLocal System
Test 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 /f
0
- "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 /f
1
- "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 /f
0
- "Advanced Settings -> IP address mapping" enabled, with GPO warning hiddenreg add HKEY_LOCAL_MACHINE\SOFTWARE\Policies\PowerToys /v MwbDisableUserDefinedIpMappingRules /t REG_DWORD /d 0 /f
1
- "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