Skip to content

AI made, no need review yet#46265

Draft
vanzue wants to merge 1 commit intomainfrom
dev/vanzue/fix-aot
Draft

AI made, no need review yet#46265
vanzue wants to merge 1 commit intomainfrom
dev/vanzue/fix-aot

Conversation

@vanzue
Copy link
Copy Markdown
Contributor

@vanzue vanzue commented Mar 19, 2026

Summary of the Pull Request

AI MADE IT, NOT TESTED YET

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

• This PR fixes two Always On Top runtime issues around
settings and the title-bar context menu.

First, it fixes a settings propagation bug where the first settings.json change after startup could be missed, so toggling an Always On Top setting did not always take effect immediately. The shared file watcher now establishes an initial timestamp baseline and correctly triggers on the first real write.

Second, it fixes the title-bar context-menu injection path for newly opened windows. The previous implementation depended on a narrow set of accessibility menu events, so some windows would not get the “Always On Top” menu entry until the shortcut was used once. The PR broadens the accepted menu event types, listens to both menu start and popup start/end events, resolves the correct top-level target window, and updates that window’s system menu reliably.

It also adds debug logging along the settings reload and system-menu update path so future reports can be traced
end to end.

Validation Steps Performed

const static wchar_t* WINDOW_IS_PINNED_PROP = L"AlwaysOnTop_Pinned";
constexpr UINT SYSTEM_MENU_TOGGLE_ALWAYS_ON_TOP_COMMAND = 0xEFE0;
constexpr ULONG_PTR SYSTEM_MENU_TOGGLE_ALWAYS_ON_TOP_COMMAND_OWNER_TAG = 0x414F5450;
constexpr DWORD SYSTEM_EVENT_MENU_START = EVENT_SYSTEM_MENUSTART;

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

MENUSTART is not a recognized word. (unrecognized-spelling)
constexpr UINT SYSTEM_MENU_TOGGLE_ALWAYS_ON_TOP_COMMAND = 0xEFE0;
constexpr ULONG_PTR SYSTEM_MENU_TOGGLE_ALWAYS_ON_TOP_COMMAND_OWNER_TAG = 0x414F5450;
constexpr DWORD SYSTEM_EVENT_MENU_START = EVENT_SYSTEM_MENUSTART;
constexpr DWORD SYSTEM_EVENT_MENU_END = EVENT_SYSTEM_MENUEND;

Check failure

Code scanning / check-spelling

Unrecognized Spelling Error

MENUEND is not a recognized word. (unrecognized-spelling)
@vanzue vanzue changed the title Fix issues AI made, no need review yet Mar 19, 2026
@github-actions
Copy link
Copy Markdown

@check-spelling-bot Report

🔴 Please review

See the 📂 files view, the 📜action log, or 📝 job summary for details.

Unrecognized words (2)

MENUEND
MENUSTART

These words are not needed and should be removed LPCFHOOKPROC

To accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the git@github.com:microsoft/PowerToys.git repository
on the dev/vanzue/fix-aot branch (ℹ️ how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/c635c2f3f714eec2fcf27b643a1919b9a811ef2e/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/23278249137/attempts/1' &&
git commit -m 'Update check-spelling metadata'
Warnings ⚠️ (1)

See the 📂 files view, the 📜action log, or 📝 job summary for details.

⚠️ Warnings Count
⚠️ ignored-expect-variant 3

See ⚠️ Event descriptions for more information.

If the flagged items are 🤯 false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it,
    try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

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