wasm: call "focus" on window, not canvas

This is necessary to have correct focus handling on webassembly/ubuntu
without this change tabbing from text input to f.ex a button would
not work.

Change-Id: I78eaa6202d8bdb87b1195d5c38a3f73570a49c90
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
This commit is contained in:
Even Oscar Andersen 2025-03-02 08:39:07 +01:00
parent 67ad781c05
commit 981757189c

View File

@ -306,9 +306,10 @@ void QWasmInputContext::updateInputElement()
m_inputElement["style"].set("height", "1px");
m_inputElement.set("value", "");
m_inputElement.call<void>("blur");
if (QWasmWindow *wasmwindow = QWasmWindow::fromWindow(focusWindow))
wasmwindow->focus();
else
m_inputElement.call<void>("blur");
return;
}