Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-136687

[regression 6.9.0] Wasm LibreOffice no longer gets keyboard input events

    XMLWordPrintable

Details

    • WebAssembly
    • a89ac4b88 (dev), 839168518 (dev)

    Description

      As originally reported in the comment at <https://codereview.qt-project.org/c/qt/qtbase/+/624759/8#message-2337fa615c59cc988da6c7a390e296a8614cc10f> "wasm: call focus on window if not editable":  At least when built against recent Qt6 dev branch, LibreOffice built for Wasm no longer receives keyboard input.  There is no prebuilt binaries of Wasm LibreOffice against Qt6 (for production, we currently still stick to Qt5, see e.g. <https://zetaoffice.net/>), but you can build it with a recipe like

      set -e
      mkdir "${HOME?}"/lo-qt6
      git -C "${HOME?}"/lo-qt6 clone https://github.com/emscripten-core/emsdk.git
      (
      cd "${HOME?}"/lo-qt6/emsdk
      ./emsdk install latest
      ./emsdk activate latest
      )
      git -C "${HOME?}"/lo-qt6 clone https://github.com/qt/qt5.git
      (
      cd "${HOME?}"/lo-qt6/qt5
      ./init-repository --module-subset=qtbase
      )
      mkdir "${HOME?}"/lo-qt6/qt5-host-build
      (
      cd "${HOME?}"/lo-qt6/qt5-host-build
      "${HOME?}"/lo-qt6/qt5/configure -prefix "${HOME?}"/lo-qt6/qt5-host-inst
      )
      cmake --build "${HOME?}"/lo-qt6/qt5-host-build
      cmake --install "${HOME?}"/lo-qt6/qt5-host-build
      mkdir "${HOME?}"/lo-qt6/qt5-build
      (
      cd "${HOME?}"/lo-qt6/qt5-build
      . "${HOME?}"/lo-qt6/emsdk/emsdk_env.sh
      CFLAGS=-sSUPPORT_LONGJMP=wasm CXXFLAGS=-sSUPPORT_LONGJMP=wasm \
      LDFLAGS=-sSUPPORT_LONGJMP=wasm "${HOME?}"/lo-qt6/qt5/configure \
      -feature-thread -feature-wasm-exceptions -xplatform wasm-emscripten \
      -prefix "${HOME?}"/lo-qt6/qt5-inst -qt-host-path \
      "${HOME?}"/lo-qt6/qt5-host-inst
      cmake --build "${HOME?}"/lo-qt6/qt5-build
      cmake --install "${HOME?}"/lo-qt6/qt5-build
      )
      git -C "${HOME?}"/lo-qt6 clone https://git.libreoffice.org/core
      (
      cd "${HOME?}"/lo-qt6/core
      . "${HOME?}"/lo-qt6/emsdk/emsdk_env.sh
      ./autogen.sh --with-distro=LibreOfficeWASM32 --disable-qt5 --enable-qt6 \
      --disable-emscripten-proxy-to-pthread \
      MOC6="${HOME?}"/lo-qt6/qt5-host-inst/libexec/moc \
      QT6DIR="${HOME?}"/lo-qt6/qt5-inst
      make
      emrun \
      "${HOME?}"/lo-qt6/core/workdir/installation/LibreOffice/emscripten/qt_soffice.html
      )

      which has been seen working with recent latest emsdk 4.0.8, recent qt5 dev head b330de576f1381eaf7c0d7d276f8eda809826382 and recent LibreOffice master head 3dd2d7f449f13bec0f0a5c6e0c33a143409c3723. (And when you then do modifications to the Qt code, use something like

      (
      . "${HOME?}"/lo-qt6/emsdk/emsdk_env.sh
      cmake --build "${HOME?}"/lo-qt6/qt5-build
      cmake --install "${HOME?}"/lo-qt6/qt5-build
      make -C "${HOME?}"/lo-qt6/core Executable_soffice_bin.clean
      make -C "${HOME?}"/lo-qt6/core
      )

      to re-link the LibreOffice binary.)

      To reproduce the issue, in the LibreOffice start center click on "Writer Document", then type "x" and observe that erroneously no text is inserted into the document.

      Attachments

        For Gerrit Dashboard: QTBUG-136687
        # Subject Branch Project Status CR V

        Activity

          People

            evenandersen Even Oscar Andersen
            sberg Stephan Bergmann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes