Skip to content

core/wayland: route keyboard to the focused window, not the pointer one#91

Merged
vaxerski merged 1 commit into
hyprwm:mainfrom
UncleJ4ck:fix-keyboard-focus-routing
Jun 8, 2026
Merged

core/wayland: route keyboard to the focused window, not the pointer one#91
vaxerski merged 1 commit into
hyprwm:mainfrom
UncleJ4ck:fix-keyboard-focus-routing

Conversation

@UncleJ4ck

@UncleJ4ck UncleJ4ck commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Keyboard input was delivered to whatever window the pointer was over. There was no wl_keyboard.enter handler, and onKey routed to m_currentWindow, which is set by pointer enter/leave.

The effect: a window that focuses an element on open (a polkit-style password dialog calling focus() after open()) received no keys until you moused over it and clicked. The compositor had given it keyboard focus, but the toolkit was looking at the pointer.

Track the keyboard-focused window from wl_keyboard.enter/leave (m_keyboardWindow) and route key events and key repeat there. Pointer events still use m_currentWindow.

keys were delivered to whatever window the pointer was over, since there was no
wl_keyboard.enter handler and routing used the pointer window. a dialog that
focused a field on open got no keys until you moused over it and clicked. track
the keyboard-focused window from wl_keyboard.enter/leave and route keys there.

@vaxerski vaxerski 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.

tnx

@vaxerski vaxerski merged commit bf9219c into hyprwm:main Jun 8, 2026
2 checks passed
@UncleJ4ck UncleJ4ck deleted the fix-keyboard-focus-routing branch June 8, 2026 12:13
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