-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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 - [MouseJump] Long lived background exe #28380
Ready for review - [MouseJump] Long lived background exe #28380
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Thanks a lot for the contribution @mikeclayton !
The code changes look good, but I've given it a test and found the following issues:
- When we kill PowerToys.exe (from Task manager or just stop debugging from VS), a PowerToys.MouseJumpUI.exe process gets leaked. Something seems to be wrong with WaitForPowerToysRunner specifically for Mouse Jump. Perhaps something different needs to be called or another resource cleaned up so it exits correctly.
- When we change a Setting like the Thumbnail size, it takes disabling and re-enabling the module for this change to take effect. Using a File Watcher like we do on other utilities may help solve this.
Please let me know if you need any help with these. 😉
@jaimecbernado - thanks for the feedback - my comments below...
Ah, I only tested gracefully exiting the runner with the "Exit" context menu command. I'll try this out and see how other modules are doing it...
Didn't even think to try this. I'll take a look and update (and add it to my regression test list 😄)... |
@jaimecbernardo - the latest commit adds a FileSystemWatcher to monitor the config file (based on the same code for PowerOCR / TextExtractor). I've not done a full regression test, but it seems to superficially work - I'll run some more tests over the next couple of days and update again once I've done that... |
Sounds good. Thank you!
|
@jaimecbernardo - I've worked through all the tests in the "Validation Steps Performed" section of the PR description at the top, and they all seem to work fine, including your internal Test Checklist, so I think this is now (finally) ready for review :-). I've not tried specifically measuring the activation time, but it feels like it's a lot snappier - it would be interesting to know if it seems that way to you as well... |
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.
Did plenty of testing, and it's working well for me. The issues I've encountered before seem to be gone too. Couldn't see much of a difference in terms of startup, perhaps just a bit faster, but I have a pretty powerful machine. Let's see how this pans out.
Code looks good too.
Thank you for the contribution!
I'll still fix a tiny telemetry issue I found (not caused by you, but was checking show preview code and verified the telemetry event there was wrong, so I just fixed it) and merge main in, do an installer to make sure everything is OK and after that I'll merge.
What is needed to get this in |
Just tested installer. All looks good. I'll merge after CI passes. |
Summary of the Pull Request
Changes the way activation works in Mouse Jump to use a long-lived background process, rather than having the main runner launch a short-lived instance of MouseJumpUI.exe every time the activation keys are pressed.
This reduces the time to display the preview popup since the Mouse Jump application itself doesn't have to load up from scratch for every activation.
PR Checklist
Detailed Description of the Pull Request / Additional comments
The main PowerToys runner now simply starts MouseJumpUI.exe when the tool is enabled, and terminates the process when the tool is disabled - this is similar to how FancyZones works, except there's no graceful IPC at present to signal to the MouseJumpUI.exe instance to close itself before it gets terminated.
The Mouse Jump C++ modulestill handles the hotkey and sends a Windows Event to the long-lived MouseJumpUI.exe to signal activation. When the UI exe receives a Windows message it displays the popup form, and hides it again when the user clicks or cancels the popup form.
Validation Steps Performed
Hotkey and size settings are automatically reloaded when config file is modified manually (e.g. in notepad) while runner and MouseJumpUI.exe are running