wasm: Re-evaluate window flags when reparenting window

We apply CSS classes to the qt-window in setWindowFlags based on
whether it hasFrame(), hasBorder(), etc. Which in turn depends on
whether the window is a top level or child window.

As a QPlatformWindow may be created while a QWindow is top level,
and then reparented into another QPlatformWindow, we need to update
the window flags, and re-sync the CSS classes, as otherwise we end
up with child windows with shadows and tile bars.

Pick-to: 6.8
Change-Id: Ibbb3d2230a880057053d7b12f93257d9b250aa6f
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Piotr Wierciński <piotr.wiercinski@qt.io>
This commit is contained in:
Tor Arne Vestbø 2024-07-04 22:57:42 +02:00
parent e0a4de17dd
commit e6db07c4e7

View File

@ -761,6 +761,10 @@ void QWasmWindow::setMask(const QRegion &region)
void QWasmWindow::setParent(const QPlatformWindow *)
{
// The window flags depend on whether we are a
// child window or not, so update them here.
setWindowFlags(window()->flags());
commitParent(parentNode());
}