wasm: set focus on canvas on new screen

This allows user to utilize the application without having to click on
it first to cause the focus-in event.

Change-Id: Ibc9582254dda91eb14ebcdf4b8ea4a4f862aa88d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Lorn Potter 2019-06-26 13:23:12 +10:00
parent 9608e996a2
commit c978de990b

View File

@ -54,6 +54,8 @@ QWasmScreen::QWasmScreen(const QString &canvasId)
m_compositor = new QWasmCompositor(this);
m_eventTranslator = new QWasmEventTranslator(this);
updateQScreenAndCanvasRenderSize();
emscripten::val canvas = emscripten::val::global(m_canvasId.toUtf8().constData());
canvas.call<void>("focus");
}
QWasmScreen::~QWasmScreen()