vcl/qt5/QtFrame.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
New commits: commit 862e86d187c53ab077b672997ca8d9623396b962 Author: Stephan Bergmann <stephan.bergm...@allotropia.de> AuthorDate: Mon Jan 27 14:08:39 2025 +0100 Commit: Stephan Bergmann <stephan.bergm...@allotropia.de> CommitDate: Mon Jan 27 15:35:36 2025 +0100 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 c3d25b55990e2205af56747aa2935f4ff11ad0aa "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.bergm...@allotropia.de> Tested-by: Jenkins diff --git a/vcl/qt5/QtFrame.cxx b/vcl/qt5/QtFrame.cxx index b8312735a098..a8debeff5a8e 100644 --- a/vcl/qt5/QtFrame.cxx +++ b/vcl/qt5/QtFrame.cxx @@ -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;