Skip to content

Send notifications even when we're unpackaged#20013

Merged
carlos-zamora merged 2 commits intodev/cazamor/toast/basefrom
dev/cazamor/toast/unpackaged
Mar 25, 2026
Merged

Send notifications even when we're unpackaged#20013
carlos-zamora merged 2 commits intodev/cazamor/toast/basefrom
dev/cazamor/toast/unpackaged

Conversation

@carlos-zamora
Copy link
Member

Summary of the Pull Request

Targets #20010

Manually assign an AUMID to our process when we're running unpackaged.
Main difference from #19937 is what AUMID we use. Before, it was per branding, but the WindowEmperor already appends an exe path hash for unpackaged instances to prevent crosstalk. Here, we're just using the same pattern: Microsoft.WindowsTerminal.<hash>.

Heavily based on #19937
Co-authored by @zadjii-msft

// and toast notifications may not be supported without additional setup.
auto notifier = ToastNotificationManager::CreateToastNotifier();
notifier.Show(toast);
// For unpackaged apps, we must pass the explicit AUMID that was registered
Copy link
Member

Choose a reason for hiding this comment

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

If you make the other block a separate PR to main, you can fold this one into #20010

Comment on lines +117 to +118
if (notifier)
{
Copy link
Member

Choose a reason for hiding this comment

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

Do those WinRT (?) functions really return null instead of throwing an HRESULT?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if CreateToastNotifier() can return null, but I have trust issues haha.

It's more there for when this fails...

if (SUCCEEDED(GetCurrentProcessExplicitAppUserModelID(&aumid)))

@carlos-zamora carlos-zamora force-pushed the dev/cazamor/toast/base branch from 4357c17 to aeb531f Compare March 25, 2026 17:29
@carlos-zamora carlos-zamora force-pushed the dev/cazamor/toast/unpackaged branch from 6d8466e to fc1b724 Compare March 25, 2026 18:33
@carlos-zamora
Copy link
Member Author

PR has been updated to move the WindowEmperor changes (unpackaged AUMID) into a separate PR targettng main.

Merging this PR into #20010 as Dustin suggested here: #20013 (comment)

@carlos-zamora carlos-zamora merged commit 9df166e into dev/cazamor/toast/base Mar 25, 2026
12 checks passed
@carlos-zamora carlos-zamora deleted the dev/cazamor/toast/unpackaged branch March 25, 2026 20:27
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.

3 participants