Skip to content

Fix X11 active window tracking - #21846

Merged
MrJul merged 2 commits into
mainfrom
fixes/x11-window-activity-transfer
Jul 25, 2026
Merged

Fix X11 active window tracking#21846
MrJul merged 2 commits into
mainfrom
fixes/x11-window-activity-transfer

Conversation

@kekekeks

@kekekeks kekekeks commented Jul 24, 2026

Copy link
Copy Markdown
Member

This masks disparity between X11 and win32/macos backends. Unlike those window activation arrives asynchronously, when dialog gets closed its parent doesn't become active window immediately.

So in modes where we can reliably track current active window, we speculatively mark the parent as new active window. If another window becomes active, it auto-corrects on the next _NET_ACTIVE_WINDOW property change (which is bound to arrive since we just closed the current active window).

The PR also addresses window.IsActive staying true after window got closed if backend haven't triggered deactivation event for some reason

Fixes #21841

@MrJul MrJul added area-x11 backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch bug labels Jul 24, 2026
@MrJul MrJul changed the title Fix for #21841 Fix X11 active window tracking Jul 24, 2026
@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0067685-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul MrJul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Works as expected.
LGTM!

@MrJul
MrJul added this pull request to the merge queue Jul 25, 2026
Merged via the queue into main with commit d6e282b Jul 25, 2026
11 checks passed
@MrJul
MrJul deleted the fixes/x11-window-activity-transfer branch July 25, 2026 14:01
@miloush miloush added the backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch label Jul 27, 2026
MrJul pushed a commit that referenced this pull request Jul 29, 2026
* Force-mark closed window as no longer active if backend didn't do it for some reason

* [X11] Speculatively mark the active closed dialog parent as active window
@MrJul MrJul added backported-12.1.x and removed backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Jul 29, 2026
MrJul pushed a commit that referenced this pull request Aug 5, 2026
* Force-mark closed window as no longer active if backend didn't do it for some reason

* [X11] Speculatively mark the active closed dialog parent as active window
@MrJul MrJul added backported-11.3.x and removed backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch labels Aug 5, 2026
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.

Incorrect active window between two dialogs

4 participants