We were unable to construct the commit group for this pull request: Author does not currently possess a GitClear subscription seat.

CmdPal: Renew foreground permission every time #50651

Closed
jiripolasek opened 9:37am on September 18, 2026 wanted to merge 4 commits into microsoft/powertoys main from
feature/50642-cmdpal-renew-foreground-permission-every-time

Pull Request Overview

  • Opened on September 18, 2026
  • Status Closed
  • Commit count 4 with first commit September 18, 2026

Total Delta

0 Total Diff Delta

Open Days

Open 1 weekdays

Test Delta

0 Diff Delta in Test Files
Breakdown by Phase

How long has this pull request spent in each phase of its lifecycle?

Fraction of total time Business days Phase
 
0 days Authoring 4 commits before pull request opened for review
 
1 day Awaiting first review

Total time for pull request 1 business day from first commit to closed PR

Author avatar

CmdPal: Renew foreground permission every time

Summary of the Pull Request

This PR passed foreground permission to extension every time a command is invoked. Because Windows can revoke the grant after input to another process.


  • Grants CoAllowSetForegroundWindow to extension every time a command is invoked.

  • Moves the grant into ExtensionWrapper.

  • Avoids lifecycle-lock waits for repeated grants and update the active extension atomically.

  • Replaces getter-count tests with grant-request coverage.

What I don't want to touch here:
- Check whether the extension is running only when switching to it, avoiding an extra COM call for repeated commands. Changing how failed checks are handled is outside this PR's scope.
- Run the command even if granting foreground permission fails.

PR Checklist


  • [x] Closes: #50642

  • [ ] Closes: #39255
    <!-- - [ ] Closes: #yyy (add separate lines for additional resolved issues) -->

  • [ ] 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

Comments Threads Pending Resolution

michaeljolley reviewed and approved this work on September 18, 2026
michaeljolley left a comment

Image

Resolved Comment Threads

No resolved comments have been left on this PR.