Skip to content

(release/25.1) hw/xwin: More adjustments to multiwindow mode focus handling#2273

Open
metux wants to merge 1 commit intorelease/25.1from
pr/hw-xwin-more-adjustments-to-multiwindow-mode-focus-handling-_2026-04-18_19-48-07
Open

(release/25.1) hw/xwin: More adjustments to multiwindow mode focus handling#2273
metux wants to merge 1 commit intorelease/25.1from
pr/hw-xwin-more-adjustments-to-multiwindow-mode-focus-handling-_2026-04-18_19-48-07

Conversation

@metux
Copy link
Copy Markdown
Contributor

@metux metux commented Apr 18, 2026

The previous change is not enough, as WM_KILLFOCUS can apparently be
sent to the window losing focus after WM_ACTIVATE has been sent to
the window gaining focus.

Try using WM_SETFOCUS instead, as that has the correct ordering and seems
more logical.

The test "!pWin || !pWin->overrideRedirect" is confusingly written: It's
true if:

(a) pWin is NULL (= X window doesn't exist, shouldn't happen), or
(b) pWin->overrideRedirect is FALSE

i.e. the intended effect is "don't give focus to override redirect windows"

There seem to be some cases where this still isn't quite correct: A
reproduction isn't known, but it seems to be related to minimizing a
maximized Windows window, and having window activation move to a
maximized X window beneath it.

Part-of: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/736

@metux metux self-assigned this Apr 18, 2026
@metux metux requested a review from a team April 18, 2026 17:48
@metux metux force-pushed the pr/hw-xwin-more-adjustments-to-multiwindow-mode-focus-handling-_2026-04-18_19-48-07 branch from 950d4b6 to 39ceed1 Compare April 19, 2026 11:53
The previous change is not enough, as WM_KILLFOCUS can apparently be
sent to the window losing focus after WM_ACTIVATE has been sent to
the window gaining focus.

Try using WM_SETFOCUS instead, as that has the correct ordering and seems
more logical.

The test "!pWin || !pWin->overrideRedirect" is confusingly written: It's
true if:

(a) pWin is NULL (= X window doesn't exist, shouldn't happen), or
(b) pWin->overrideRedirect is FALSE

i.e. the intended effect is "don't give focus to override redirect windows"

There seem to be some cases where this still isn't quite correct: A
reproduction isn't known, but it seems to be related to minimizing a
maximized Windows window, and having window activation move to a
maximized X window beneath it.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/736>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
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.

2 participants