Remove a hack at least for Emscripten --enable-qt6

That "no idea, why Qt::WA_NativeWindow breaks the menubar for EMSCRIPTEN" had
been added in c3d25b5599 "WASM Qt: various
EMSCRIPTEN adaptions", but with no explanation beyond "Don't create a native
window handle".  At least for recent Qt6 dev (towards Qt 6.10), that doesn't
appear to cause any (obvious) issues, however, but would cause some
"qt.core.qobject.connect: QObject::connect(QWindow, QtFrame): invalid nullptr
parameter" console log from

> $QObjectPrivate::connectImpl(QObject const*, int, QObject const*, void**, QtPrivate::QSlotObjectBase*, int, int const*, QMetaObject const*) @ soffice.wasm:0x7a88b4c
> $QObject::connectImpl(QObject const*, void**, QObject const*, void**, QtPrivate::QSlotObjectBase*, Qt::ConnectionType, int const*, QMetaObject const*) @ soffice.wasm:0x7a8892c
> $QtFrame::Show(bool, bool) @ soffice.wasm:0x659b18f
> $non-virtual thunk to QtFrame::Show(bool, bool) @ soffice.wasm:0x659b695
> $vcl::Window::Show(bool, ShowFlags) @ soffice.wasm:0x1557411
> $vcl::Window::Show(bool, ShowFlags) @ soffice.wasm:0x155733d
> $VCLXWindow::setVisible(unsigned char) @ soffice.wasm:0x129b055
> $non-virtual thunk to VCLXWindow::setVisible(unsigned char) @ soffice.wasm:0x129b0f6
> $desktop::Desktop::ShowBackingComponent(desktop::Desktop*) @ soffice.wasm:0xc15712
> $desktop::Desktop::Main() @ soffice.wasm:0xc13b1a
> $ImplSVMain() @ soffice.wasm:0x18b2cde
> $SVMain() @ soffice.wasm:0x18b4eef
> $soffice_main @ soffice.wasm:0xc1c35d
> $main @ soffice.wasm:0xb95548

Change-Id: I8f12ac8c3d196ed69bea43589a34b79912c1ef36
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180783
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
This commit is contained in:
Stephan Bergmann
2025-01-27 15:35:36 +01:00
parent 907da00ef4
commit 862e86d187
+6 -3
View File
@@ -269,13 +269,16 @@ QWindow* QtFrame::windowHandle() const
assert(pChild->window() == pChild);
switch (m_aSystemData.platform)
{
case SystemEnvData::Platform::WASM:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// no idea, why Qt::WA_NativeWindow breaks the menubar for EMSCRIPTEN
pChild->setAttribute(Qt::WA_NativeWindow);
break;
#endif
case SystemEnvData::Platform::Wayland:
case SystemEnvData::Platform::Xcb:
pChild->setAttribute(Qt::WA_NativeWindow);
break;
case SystemEnvData::Platform::WASM:
// no idea, why Qt::WA_NativeWindow breaks the menubar for EMSCRIPTEN
break;
case SystemEnvData::Platform::Invalid:
std::abort();
break;