wl_backend: fall back to modalView for key event routing

When focusInfo has no target, route key events to the modal view
so text fields in modal dialogs (run dialog) receive input.
This commit is contained in:
Levi Neely 2026-05-14 19:02:36 +02:00
parent 81f60abca7
commit d883166d4c
1 changed files with 2 additions and 0 deletions

View File

@ -1698,6 +1698,8 @@ handle_keyboard_key(struct wl_listener *listener, void *data)
W_FocusInfo *finfo = wmscr->focusInfo;
W_View *target = (finfo && finfo->focused) ? finfo->focused
: (finfo && finfo->toplevel) ? finfo->toplevel : NULL;
if (!target && wmscr->modalView)
target = wmscr->modalView;
ev.window = target ? (WNativeWindow)target->window : WNATIVE_NONE;
ev.u.key.keycode = keycode;