Alexandros Frantzis (@afrantzis) commented about dlls/winewayland.drv/wayland_keyboard.c:
+{ + struct wayland_keyboard *keyboard = &process_wayland.keyboard; + HWND hwnd; + + if (!wl_surface) return; + + /* The wl_surface user data remains valid and immutable for the whole + * lifetime of the object, so it's safe to access without locking. */ + hwnd = wl_surface_get_user_data(wl_surface); + TRACE("serial=%u hwnd=%p\n", serial, hwnd); + + pthread_mutex_lock(&keyboard->mutex); + keyboard->focused_hwnd = hwnd; + pthread_mutex_unlock(&keyboard->mutex); + + NtUserSetForegroundWindow(hwnd); Please see https://gitlab.winehq.org/wine/wine/-/merge_requests/4102#note_51733 for some problems with unconditionally setting the foreground window. Perhaps it would be fine to land this as is to make keyboard input available to people, and iterate on a solution for the issue later (unless you already have a good idea about solving this?).
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/4204#note_51737