xwayland: route keyboard events via wlr_seat_keyboard_notify_enter

The XWayland focus path only called wlr_xwayland_surface_activate (X11
focus) but did not notify the wlr_seat about keyboard focus. Without
wlr_seat_keyboard_notify_enter, key events were never forwarded to the
XWayland surface via the Wayland transport.

Now wl_focus_set for XWayland surfaces sets the seat keyboard and calls
wlr_seat_keyboard_notify_enter, matching the XDG toplevel path.
This commit is contained in:
Window Maker 2026-05-25 11:45:47 +02:00
parent 5bff28efcd
commit 703872bcca
1 changed files with 10 additions and 2 deletions

View File

@ -5036,10 +5036,18 @@ wl_focus_set(WNativeWindow win, int revert_to, unsigned long timestamp)
}
struct wl_toplevel_view *v = wl_find_view_by_id(win);
if (!v) return;
/* Phase 17: XWayland windows use wlr_xwayland_surface_activate. */
/* Phase 17: XWayland windows need both X11 focus and Wayland seat focus. */
if (v->xw_surface) {
wlr_xwayland_surface_activate(v->xw_surface, true);
wwarning("wl_backend: focus_set(xwayland) id=0x%lx", win);
if (v->xw_surface->surface) {
if (wl_state.keyboard_dev) {
struct wlr_keyboard *kb = wlr_keyboard_from_input_device(wl_state.keyboard_dev);
wlr_seat_set_keyboard(wl_state.seat, kb);
}
wlr_seat_keyboard_notify_enter(wl_state.seat,
v->xw_surface->surface,
NULL, 0, NULL);
}
return;
}
if (!v->xdg_surface || !v->xdg_surface->surface)