Fix app activation for macOS - #21799
Merged
MrJul merged 1 commit intoJul 24, 2026
Merged
Conversation
JakobScholer
marked this pull request as ready for review
July 18, 2026 15:03
|
You can test this PR using the following package version. |
JakobScholer
marked this pull request as draft
July 18, 2026 16:40
JakobScholer
marked this pull request as ready for review
July 18, 2026 16:40
|
You can test this PR using the following package version. |
JakobScholer
marked this pull request as draft
July 19, 2026 18:53
JakobScholer
marked this pull request as ready for review
July 19, 2026 18:53
|
You can test this PR using the following package version. |
MrJul
approved these changes
Jul 24, 2026
MrJul
left a comment
Member
There was a problem hiding this comment.
Tested, works as expected.
LGTM!
MrJul
pushed a commit
that referenced
this pull request
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does the pull request do?
On macOS, opening a file picker shortly after launch can leave it permanently
unresponsive: the dialog appears and Cancel, path navigation and right-click work,
but the file list and left sidebar don't respond to clicks for the rest of the
app's lifetime. The only user workaround is switching to another app and back.
What is the current behavior?
Avalonia shows the main window and activates the app via
[NSApp activateIgnoringOtherApps:YES]from
Show, which runs duringOnFrameworkInitializationCompletedâ before thenative run loop is entered (
-[NSApplication run]). Activating the app before it hasfinished launching produces a degraded activation: the app reports as active and is
frontmost in the menu bar, but the WindowServer never performs a real become-active
transition. As a result the out-of-process open/save panel view never starts routing
mouse-selection events to its file list and sidebar. A genuine app switch (resign â
become active) is the only thing that repairs it.
This is timing-dependent; anything that slows early startup makes the window easier to
hit â e.g.
WindowState="Maximized"or running under a debugger.What is the updated/expected behavior?
The first app activation is deferred to the next run-loop turn when the app isn't
running yet, so it becomes a clean WindowServer transition and the picker is fully
interactive immediately. Activations once the app is running are unchanged.
How was the solution implemented (if it's not obvious)?
Added a small
ActivateApplication()helper inWindowBaseImpl.mmused byShowand
Activate:Checklist
WindowBaseImpl.mm), no public API affected.Breaking changes
Obsoletions / Deprecations
Fixed issues
Fixes #21718