Skip to content
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

WIP - [Mouse Without Borders] - refactoring "Common" classes - Common.Log.cs, Common.Receiver.cs #35156 #35726

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

mikeclayton
Copy link
Contributor

@mikeclayton mikeclayton commented Nov 2, 2024

Summary of the Pull Request

Part 2 of a slow-running refactor of the giant "Common" class in Mouse Without Borders into individual classes with tighter private scope.

  • Extract the "Thread" code from Common.Log.cs into a separate Thread.cs
  • Extract the "Common" code from Common.Receiver.cs into a separate static "Receiver" class in Receiver.cs
  • Update references to the Thread and Receiver members in the new locations
  • Update unit test to verify functionality has only changed in an expected way

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:

    • Verify that PowerToys is properly installed on both PCs.
  • Setup Connection:

    • Open MWB's settings on the first PC and click the "New Key" button. Verify that a new security key is generated.
    • Copy the generated security key and paste it in the corresponding input field in the settings of MWB on the second PC. Also enter the name of the first PC in the required field.
    • Press "Connect" and verify that the machine layout now includes two PC tiles, each displaying their respective PC names.
  • Verify Connection Status:

    • Ensure that the border of the remote PC turns green, indicating a successful connection.
    • Enter an incorrect security key and verify that the border of the remote PC turns red, indicating a failed connection.
  • Test Remote Mouse/Keyboard Control:

    • With the PCs connected, test the mouse/keyboard control from one PC to another. Verify that the mouse/keyboard inputs are correctly registered on the other PC.
    • Test remote mouse/keyboard control across all four PCs, if available. Verify that inputs are correctly registered on each connected PC when the mouse is active there.
      • unable to test - only 2 machines available
  • Test Remote Control with Elevated Apps:

    • Open an elevated app on one of the PCs. Verify that without "Use Service" enabled, PowerToys does not control the elevated app.
    • Enable "Use Service" in MWB's settings. Verify that PowerToys can now control the elevated app remotely. Verify that MWB processes are running as LocalSystem, while the MWB helper process is running non-elevated.
    • Toggle "Use Service" again, verify that each time you do that, the MWB processes are restarted.
    • Run PowerToys elevated on one of the machines, verify that you can control elevated apps remotely now on that machine.
  • Test Module Enable Status:

    • For all combinations of "Use Service"/"Run PowerToys as admin", try enabling/disabling MWB module and verify that it's indeed being toggled using task manager.
  • Test Disconnection/Reconnection:

    • Disconnect one of the PCs from network. Verify that the machine layout updates to reflect the disconnection.
    • Do the same, but now by exiting PowerToys.
    • Start PowerToys again, verify that the PCs are reconnected.
  • Test Various Local Network Conditions:

    • Test MWB performance under various network conditions (e.g., low bandwidth, high latency). Verify that the tool maintains a stable connection and functions correctly.
  • Clipboard Sharing:

    • Copy some text on one PC and verify that the same text can be pasted on another PC.
    • Use the screenshot key and Win+Shift+S to take a screenshot on one PC and verify that the screenshot can be pasted on another PC.
    • Copy a file in Windows Explorer and verify that the file can be pasted on another PC. Make sure the file size is below 100MB.
    • Try to copy multiple files and directories and verify that it's not possible (only the first selected file is being copied).
  • Drag and Drop:

    • Drag a file from Windows Explorer on one PC, cross the screen border onto another PC, and release it there. Verify that the file is copied to the other PC. Make sure the file size is below 100MB.
    • While dragging the file, verify that a corresponding icon is displayed under the mouse cursor.
    • Without moving the mouse from one PC to the target PC, press CTRL+ALT+F1/2/3/4 hotkey to switch to the target PC directly and verify that file sharing/dropping is not working.
  • Lock and Unlock with "Use Service" Enabled:

    • Enable "Use Service" in MWB's settings.
    • Lock a remote PC using Win+L, move the mouse to it remotely, and try to unlock it. Verify that you can unlock the remote PC.
    • Disable "Use Service" in MWB's settings, lock the remote PC, move the mouse to it remotely, and try to unlock it. Verify that you can't unlock the remote PC.
  • Test Settings:

    • Change the rest of available settings on MWB page and verify that each setting works as described.

@mikeclayton mikeclayton marked this pull request as draft November 2, 2024 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant