Skip to content

[Advanced Paste][PowerDisplay] Move from own IPC implementation to the one from PowerToys.interop - #50253

Open
Noraa Junker (noraa-junker) wants to merge 5 commits into
mainfrom
dev/noraa-junker/use-ipc-for-advancepaste
Open

[Advanced Paste][PowerDisplay] Move from own IPC implementation to the one from PowerToys.interop#50253
Noraa Junker (noraa-junker) wants to merge 5 commits into
mainfrom
dev/noraa-junker/use-ipc-for-advancepaste

Conversation

@noraa-junker

Copy link
Copy Markdown
Collaborator

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

  • Closes: #xxx
  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

@noraa-junker
Noraa Junker (noraa-junker) marked this pull request as ready for review August 30, 2026 18:34
@github-actions

Copy link
Copy Markdown

🧭 PR intake

Visual evidence: Not needed — The changed files do not indicate a visible UI change. No visual evidence is expected.

Recommendation

Link the issue this PR fixes using a closing keyword such as Closes #123.

✅ Ready for review

This PR passed the automated intake checks and is ready for maintainer review.

Automated PR intake; PowerToys maintainers make final decisions.

@MuyuanMS Muyuan Li (MuyuanMS) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@MuyuanMS Muyuan Li (MuyuanMS) self-assigned this Sep 1, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants