[Advanced Paste][PowerDisplay] Move from own IPC implementation to the one from PowerToys.interop - #50253
Conversation
…e one from PowerToys.interop
🧭 PR intakeVisual evidence: Not needed — The changed files do not indicate a visible UI change. No visual evidence is expected. Recommendation
✅ Ready for reviewThis PR passed the automated intake checks and is ready for maintainer review. Automated PR intake; PowerToys maintainers make final decisions. |
Muyuan Li (MuyuanMS)
left a comment
There was a problem hiding this comment.
Thanks for consolidating these IPC implementations. The migration needs the following framing, ownership, and startup-order fixes before merge.
Own native IPC endpoints and start the listener before the child
Severity: high
Both process managers store an owning TwoWayPipeMessageIPC in a raw pointer, so failed starts, normal stops, and restarts can leave the endpoint and its worker resources alive. Please use std::unique_ptr, reset it during failure and shutdown, and create/start the named-pipe listener before launching the module process. This gives the child a ready endpoint for its first message and makes restart cleanup deterministic.
Retain and close managed IPC for the application lifetime
Severity: high
The new TwoWayPipeMessageIPCManaged instances are local variables, so the applications cannot keep the callback channel alive or end it during shutdown. Retain each endpoint in the application object and call End() from its existing disposal/shutdown path. For PowerDisplay, initialize the main window before beginning IPC processing and trim the received message before parsing so the first delivered command cannot be dropped or retain a legacy delimiter.
…layProcessManager.cpp Co-authored-by: Muyuan Li <116717757+MuyuanMS@users.noreply.github.com>
…dPasteProcessManager.cpp Co-authored-by: Muyuan Li <116717757+MuyuanMS@users.noreply.github.com>
Summary of the Pull Request
Reduces different IPC implementations by removing the ones from Advanced Paste and PowerDisplay and replacing them with the one from PowerToys.interop which is used in the most places.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed