wasm: Apply window mask during QWasmWindow initialization

We need to apply properties of the QWindow the underlying "native
window", in this case our <div>, on construction, without waiting
for the user to call one of the QWindow setters.

Change-Id: Id422a9424f584e2269ef333e2c7c88a123ecb70b
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit b0827bf8d43768153186181a7ef8fde3f9c95d40)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tor Arne Vestbø 2023-08-08 15:29:07 +02:00 committed by Qt Cherry-pick Bot
parent 23b4ab8f45
commit 31a26a4f2e

View File

@ -5,6 +5,7 @@
#include <private/qguiapplication_p.h> #include <private/qguiapplication_p.h>
#include <QtCore/qfile.h> #include <QtCore/qfile.h>
#include <QtGui/private/qwindow_p.h> #include <QtGui/private/qwindow_p.h>
#include <QtGui/private/qhighdpiscaling_p.h>
#include <private/qpixmapcache_p.h> #include <private/qpixmapcache_p.h>
#include <QtGui/qopenglfunctions.h> #include <QtGui/qopenglfunctions.h>
#include <QBuffer> #include <QBuffer>
@ -214,6 +215,8 @@ void QWasmWindow::initialize()
setWindowState(window()->windowStates()); setWindowState(window()->windowStates());
setWindowFlags(window()->flags()); setWindowFlags(window()->flags());
setWindowTitle(window()->title()); setWindowTitle(window()->title());
setMask(QHighDpi::toNativeLocalRegion(window()->mask(), window()));
if (window()->isTopLevel()) if (window()->isTopLevel())
setWindowIcon(window()->icon()); setWindowIcon(window()->icon());
m_normalGeometry = rect; m_normalGeometry = rect;