esternin / eXtrema

https://www.physics.brocku.ca/Labs/extrema/
GNU General Public License v2.0
6 stars 1 forks source link

wxWidgets html Help does not render under Chromebook #57

Open esternin opened 1 year ago

esternin commented 1 year ago

While wxWidget 3.2.1 is a terrific improvement on high-DPI screens (kudos! @vadz), including the Chromebook [currently at Version 105.0.5195.134 (Official Build) (64-bit), Debian GNU/Linux 11.5 (bullseye)], the wxHtmlHelpController does not render html markup.

(I do not seem to recall if this was true for Chrome OS versions in the mid-90s. Perhaps it's a new bug, but the old extrema executable compiled with 3.1.5 back then does show the same, under the current OS, so maybe I never noticed back then. Or, did some gdk part get pushed out into a separate component that needs installing?)

image

$ gtk-query-settings 
              gtk-double-click-time: 400
          gtk-double-click-distance: 5
                   gtk-cursor-blink: TRUE
              gtk-cursor-blink-time: 1200
           gtk-cursor-blink-timeout: 10
                   gtk-split-cursor: TRUE
            gtk-cursor-aspect-ratio: 0.040000
                     gtk-theme-name: "Adwaita"
                gtk-icon-theme-name: "Adwaita"
!           gtk-fallback-icon-theme: NULL
                 gtk-key-theme-name: "Default"
                 gtk-menu-bar-accel: "F10"
             gtk-dnd-drag-threshold: 8
                      gtk-font-name: "Roboto 10"
!                    gtk-icon-sizes: "\"panel-menu=12,11:panel=12,11:gtk-menu=12,11:gtk-large-toolbar=12,11:gtk-small-toolbar=12,11:gtk-button=12,11\""
                        gtk-modules: NULL
                  gtk-xft-antialias: 1
                    gtk-xft-hinting: 1
                  gtk-xft-hintstyle: "hintslight"
                       gtk-xft-rgba: "none"
                        gtk-xft-dpi: 98304
              gtk-cursor-theme-name: "Adwaita"
              gtk-cursor-theme-size: 24
       gtk-alternative-button-order: FALSE
        gtk-alternative-sort-arrows: FALSE
!        gtk-show-input-method-menu: FALSE
!             gtk-show-unicode-menu: FALSE
!               gtk-timeout-initial: 500
!                gtk-timeout-repeat: 50
!                gtk-timeout-expand: 500
!                  gtk-color-scheme: ""
              gtk-enable-animations: TRUE
!              gtk-touchscreen-mode: FALSE
!               gtk-tooltip-timeout: 500
!        gtk-tooltip-browse-timeout: 60
!   gtk-tooltip-browse-mode-timeout: 500
!            gtk-keynav-cursor-only: FALSE
!            gtk-keynav-wrap-around: TRUE
                     gtk-error-bell: TRUE
!                        color-hash: ((GHashTable*) 0x578ce6d1fd20)
!          gtk-file-chooser-backend: NULL
                 gtk-print-backends: "file,cups,cloudprint"
          gtk-print-preview-command: "evince --unlink-tempfile --preview --print-settings %s %f"
               gtk-enable-mnemonics: TRUE
                  gtk-enable-accels: TRUE
!            gtk-recent-files-limit: 50
                      gtk-im-module: ""
           gtk-recent-files-max-age: -1
           gtk-fontconfig-timestamp: 0
               gtk-sound-theme-name: "freedesktop"
   gtk-enable-input-feedback-sounds: FALSE
            gtk-enable-event-sounds: TRUE
!               gtk-enable-tooltips: TRUE
!                 gtk-toolbar-style: GTK_TOOLBAR_BOTH_HORIZ
!             gtk-toolbar-icon-size: GTK_ICON_SIZE_LARGE_TOOLBAR
!                gtk-auto-mnemonics: TRUE
    gtk-primary-button-warps-slider: TRUE
!                 gtk-visible-focus: GTK_POLICY_AUTOMATIC
  gtk-application-prefer-dark-theme: FALSE
!                 gtk-button-images: FALSE
          gtk-entry-select-on-focus: TRUE
    gtk-entry-password-hint-timeout: 0
!                   gtk-menu-images: FALSE
!          gtk-menu-bar-popup-delay: 0
!     gtk-scrolled-window-placement: GTK_CORNER_TOP_LEFT
!             gtk-can-change-accels: FALSE
!              gtk-menu-popup-delay: 225
!            gtk-menu-popdown-delay: 1000
          gtk-label-select-on-focus: TRUE
!                 gtk-color-palette: "black:white:gray50:red:purple:blue:light blue:green:yellow:orange:lavender:brown:goldenrod4:dodger blue:pink:light green:gray10:gray30:gray75:gray90"
!              gtk-im-preedit-style: GTK_IM_PREEDIT_CALLBACK
!               gtk-im-status-style: GTK_IM_STATUS_CALLBACK
           gtk-shell-shows-app-menu: FALSE
            gtk-shell-shows-menubar: FALSE
            gtk-shell-shows-desktop: FALSE
              gtk-decoration-layout: ":minimize,maximize,close"
          gtk-titlebar-double-click: "toggle-maximize"
          gtk-titlebar-middle-click: "none"
           gtk-titlebar-right-click: "menu"
             gtk-dialogs-use-header: TRUE
           gtk-enable-primary-paste: TRUE
           gtk-recent-files-enabled: TRUE
                gtk-long-press-time: 500
               gtk-keynav-use-caret: FALSE
              gtk-overlay-scrolling: TRUE
esternin commented 1 year ago

This is definitely a wx problem, as samples/html/help displays the same: image

vadz commented 1 year ago

This is truly weird, I have no idea what could be causing this, the sample uses wxHtmlWindow which is implemented in wx itself and so should look the same no matter where.

And, of course, I don't see the problem here, under desktop Linux...

esternin commented 1 year ago

And, of course, I don't see the problem here, under desktop Linux...

For a short while, you could install ChomeOS in a VirtualBox, see here, but Google quashed that by purchasing Neverware and taking their servers out of circulation. Maybe if we can find an old CloudReady_Free_x64_Virtualbox.ova, open it as VirtualBox, enable "Linux" under it, you might have a virtual chromebook to test on.

Edit: here's one

esternin commented 1 year ago

install ChomeOS in a VirtualBox

The problem with my suggestion is that while this virtual-box chromebook starts, it immediately updates itself, and the display stop working. And there is no way to turn it off in that version. Except, I guess, disable network access as soon as you log in, or simply never to reboot. But then, there is no way to install "Linux (beta)", a real Catch-22.

I should just send you a Chromebook.

esternin commented 11 months ago

@vadz : I compiled wxWidgets 3.2.3 under Debian, made an AppImage, moved it to the Chromebook, and this issue is still there, i.e. raw HTML code is shown, not rendered. There are no notable errors at runtime (gtkScrollbar complains about undefined size, but it's benign, I think). The same AppImage running under Debian or Ubuntu performs as expected.

My guess is some component library is not installed/available under the Chromebook/xwayland version of Linux. Could you help me identify which one?

I looked for all apt list --installed *gdk* *gtk* *html* *web* packages (attached). Do you see any glaring omissions?

installed.txt

Alternatively, could it be that wxHtmlWindow is configured to only recognize .html files, while we used .htm ones? Can I override it, or is it reading some system-wide mime settings which are set too restrictively? In /usr/share/mime/packages/freedesktop.org.xml I do have:

  <mime-type type="text/html">
    ...
    <acronym>HTML</acronym>
    <expanded-acronym>HyperText Markup Language</expanded-acronym>
    <sub-class-of type="text/plain"/>
    ...
    <glob pattern="*.html" weight="80"/>
    <glob pattern="*.htm" weight="80"/>
  </mime-type>
vadz commented 11 months ago

This looks a lot like https://github.com/wxWidgets/wxWidgets/issues/23888 and while that one is under Windows, it could be due to the same underlying problem: somehow the tag handlers are not getting initialized. Unfortunately I still have no idea why would this happen. I don't even remember, does eXtrema use static or shared wx libraries?

I can say that this definitely doesn't have anything to do with .htm vs .html.

esternin commented 11 months ago

wxWidgets are compiled following all-default ../configure; eXtrema uses

../configure --with-MUD=../../mud --with-wx-config=../../wxwidgets-3.2.3/build-linux-x86_64/wx-config CXXFLAGS=-std=c++11 --no-create --no-recursion

so shared libraries, specifically for the executable that gets made into AppImage on my production RHEL 7 box and works fine under RHEL7 or Ubuntu <=23.04, but not on Debian 11(bullseye) that is Chromebook Linux :

ldd build-linux-x86_64/src/extrema
    linux-vdso.so.1 =>  (0x00007ffea0998000)
    libwx_baseu-3.2.so.0 => /usr/local/lib/libwx_baseu-3.2.so.0 (0x00007f26a0195000)
    libwx_baseu_xml-3.2.so.0 => /usr/local/lib/libwx_baseu_xml-3.2.so.0 (0x00007f269ff83000)
    libwx_gtk3u_core-3.2.so.0 => /usr/local/lib/libwx_gtk3u_core-3.2.so.0 (0x00007f269f49e000)
    libwx_gtk3u_html-3.2.so.0 => /usr/local/lib/libwx_gtk3u_html-3.2.so.0 (0x00007f269f1bd000)
    libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f269eeb5000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f269ebb3000)
    libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f269e99d000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f269e781000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f269e3b3000)
    libz.so.1 => /lib64/libz.so.1 (0x00007f269e19d000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f269df99000)
    libcurl.so.4 => /lib64/libcurl.so.4 (0x00007f269dd2f000)
    libexpat.so.1 => /lib64/libexpat.so.1 (0x00007f269db04000)
    libgtk-3.so.0 => /lib64/libgtk-3.so.0 (0x00007f269d1fc000)
    libgdk-3.so.0 => /lib64/libgdk-3.so.0 (0x00007f269cf12000)
    libatk-1.0.so.0 => /lib64/libatk-1.0.so.0 (0x00007f269ccec000)
    libgio-2.0.so.0 => /lib64/libgio-2.0.so.0 (0x00007f269c94c000)
    libpangocairo-1.0.so.0 => /lib64/libpangocairo-1.0.so.0 (0x00007f269c73e000)
    libgdk_pixbuf-2.0.so.0 => /lib64/libgdk_pixbuf-2.0.so.0 (0x00007f269c516000)
    libcairo-gobject.so.2 => /lib64/libcairo-gobject.so.2 (0x00007f269c30d000)
    libpango-1.0.so.0 => /lib64/libpango-1.0.so.0 (0x00007f269c0c7000)
    libcairo.so.2 => /lib64/libcairo.so.2 (0x00007f269bd90000)
    libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x00007f269bb3f000)
    libgthread-2.0.so.0 => /lib64/libgthread-2.0.so.0 (0x00007f269b93d000)
    libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007f269b627000)
    libX11.so.6 => /lib64/libX11.so.6 (0x00007f269b2e9000)
    libXxf86vm.so.1 => /lib64/libXxf86vm.so.1 (0x00007f269b0e3000)
    libSM.so.6 => /lib64/libSM.so.6 (0x00007f269aedb000)
    libpangoft2-1.0.so.0 => /lib64/libpangoft2-1.0.so.0 (0x00007f269acc5000)
    libfontconfig.so.1 => /lib64/libfontconfig.so.1 (0x00007f269aa83000)
    libfreetype.so.6 => /lib64/libfreetype.so.6 (0x00007f269a7c4000)
    libpng15.so.15 => /lib64/libpng15.so.15 (0x00007f269a599000)
    libjpeg.so.62 => /lib64/libjpeg.so.62 (0x00007f269a344000)
    libtiff.so.5 => /lib64/libtiff.so.5 (0x00007f269a0d0000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f26a0696000)
    libidn.so.11 => /lib64/libidn.so.11 (0x00007f2699e9d000)
    libssh2.so.1 => /lib64/libssh2.so.1 (0x00007f2699c70000)
    libssl3.so => /lib64/libssl3.so (0x00007f2699a0b000)
    libsmime3.so => /lib64/libsmime3.so (0x00007f26997e3000)
    libnss3.so => /lib64/libnss3.so (0x00007f26994a9000)
    libnssutil3.so => /lib64/libnssutil3.so (0x00007f2699278000)
    libplds4.so => /lib64/libplds4.so (0x00007f2699074000)
    libplc4.so => /lib64/libplc4.so (0x00007f2698e6f000)
    libnspr4.so => /lib64/libnspr4.so (0x00007f2698c30000)
    libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f26989e3000)
    libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f26986fa000)
    libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f26984c7000)
    libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f26982c3000)
    liblber-2.4.so.2 => /lib64/liblber-2.4.so.2 (0x00007f26980b4000)
    libldap-2.4.so.2 => /lib64/libldap-2.4.so.2 (0x00007f2697e5f000)
    libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0 (0x00007f2697c5b000)
    libXi.so.6 => /lib64/libXi.so.6 (0x00007f2697a4b000)
    libXfixes.so.3 => /lib64/libXfixes.so.3 (0x00007f2697845000)
    libatk-bridge-2.0.so.0 => /lib64/libatk-bridge-2.0.so.0 (0x00007f2697616000)
    libwayland-client.so.0 => /lib64/libwayland-client.so.0 (0x00007f2697407000)
    libepoxy.so.0 => /lib64/libepoxy.so.0 (0x00007f26970db000)
    libXinerama.so.1 => /lib64/libXinerama.so.1 (0x00007f2696ed8000)
    libXrandr.so.2 => /lib64/libXrandr.so.2 (0x00007f2696ccd000)
    libXcursor.so.1 => /lib64/libXcursor.so.1 (0x00007f2696ac2000)
    libXcomposite.so.1 => /lib64/libXcomposite.so.1 (0x00007f26968bf000)
    libXdamage.so.1 => /lib64/libXdamage.so.1 (0x00007f26966bc000)
    libxkbcommon.so.0 => /lib64/libxkbcommon.so.0 (0x00007f269647c000)
    libwayland-cursor.so.0 => /lib64/libwayland-cursor.so.0 (0x00007f2696274000)
    libwayland-egl.so.1 => /lib64/libwayland-egl.so.1 (0x00007f2696072000)
    libXext.so.6 => /lib64/libXext.so.6 (0x00007f2695e60000)
    librt.so.1 => /lib64/librt.so.1 (0x00007f2695c58000)
    libffi.so.6 => /lib64/libffi.so.6 (0x00007f2695a50000)
    libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f26957ee000)
    libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f26955c7000)
    libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f26953ad000)
    libmount.so.1 => /lib64/libmount.so.1 (0x00007f269516a000)
    libpixman-1.so.0 => /lib64/libpixman-1.so.0 (0x00007f2694ec1000)
    libEGL.so.1 => /lib64/libEGL.so.1 (0x00007f2694cad000)
    libxcb-shm.so.0 => /lib64/libxcb-shm.so.0 (0x00007f2694aa9000)
    libxcb.so.1 => /lib64/libxcb.so.1 (0x00007f2694881000)
    libxcb-render.so.0 => /lib64/libxcb-render.so.0 (0x00007f2694673000)
    libXrender.so.1 => /lib64/libXrender.so.1 (0x00007f2694468000)
    libGL.so.1 => /lib64/libGL.so.1 (0x00007f26941dc000)
    libthai.so.0 => /lib64/libthai.so.0 (0x00007f2693fd0000)
    libfribidi.so.0 => /lib64/libfribidi.so.0 (0x00007f2693db4000)
    libICE.so.6 => /lib64/libICE.so.6 (0x00007f2693b98000)
    libuuid.so.1 => /lib64/libuuid.so.1 (0x00007f2693993000)
    libharfbuzz.so.0 => /lib64/libharfbuzz.so.0 (0x00007f26936f6000)
    libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f26934e6000)
    libjbig.so.2.0 => /lib64/libjbig.so.2.0 (0x00007f26932da000)
    libssl.so.10 => /lib64/libssl.so.10 (0x00007f2693068000)
    libcrypto.so.10 => /lib64/libcrypto.so.10 (0x00007f2692c05000)
    libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f26929f5000)
    libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f26927f1000)
    libsasl2.so.3 => /lib64/libsasl2.so.3 (0x00007f26925d4000)
    libatspi.so.0 => /lib64/libatspi.so.0 (0x00007f26923a3000)
    libdbus-1.so.3 => /lib64/libdbus-1.so.3 (0x00007f2692153000)
    libblkid.so.1 => /lib64/libblkid.so.1 (0x00007f2691f13000)
    libGLdispatch.so.0 => /lib64/libGLdispatch.so.0 (0x00007f2691c5d000)
    libXau.so.6 => /lib64/libXau.so.6 (0x00007f2691a59000)
    libGLX.so.0 => /lib64/libGLX.so.0 (0x00007f2691827000)
    libgraphite2.so.3 => /lib64/libgraphite2.so.3 (0x00007f26915f9000)
    libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f26913c2000)
    libsystemd.so.0 => /lib64/libsystemd.so.0 (0x00007f2691191000)
    libfreebl3.so => /lib64/libfreebl3.so (0x00007f2690f8e000)
    libcap.so.2 => /lib64/libcap.so.2 (0x00007f2690d89000)
    liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f2690b63000)
    liblz4.so.1 => /lib64/liblz4.so.1 (0x00007f2690954000)
    libgcrypt.so.11 => /lib64/libgcrypt.so.11 (0x00007f26906d3000)
    libgpg-error.so.0 => /lib64/libgpg-error.so.0 (0x00007f26904ce000)
    libdw.so.1 => /lib64/libdw.so.1 (0x00007f269027d000)
    libattr.so.1 => /lib64/libattr.so.1 (0x00007f2690078000)
    libelf.so.1 => /lib64/libelf.so.1 (0x00007f268fe60000)
esternin commented 11 months ago

Just to add: the natively compiled/installed executable also does not render. I just recompiled wxWidgets 3.2.3, then recompiled/linked to it eXtrema directly under Debian @ Chromebook - same symptoms. It has persisted over several wxWidgets versions now, native compile or imported AppImage.

I've re-built wxWidgets with

../configure --disable-shared

and added --enable-static to extrema's ../configure ..., and the resulting executable has no dynamic wx libraries, but the behaviour is exactly the same. So the "solution" suggested in https://github.com/wxWidgets/wxWidgets/issues/23888 does not seem to do it.

vadz commented 11 months ago

Sorry, I really don't see anything wrong. If you've already built wx, could you please build wx HTML sample, i.e. do, in the build directory, cd samples/html/test; make, and check if it works correctly?

esternin commented 11 months ago
~/wxWidgets-3.2.3/build-linux-x86_64/samples/html/test$ make
~/wxWidgets-3.2.3/build-linux-x86_64/bk-deps g++ -c -o test_test.o -I~/wxWidgets-3.2.3/build-linux-x86_64/lib/wx/include/gtk3-unicode-static-3.2 -I../../../../include -D_FILE_OFFSET_BITS=64 -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/atk-1.0 -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include  -D__WXGTK__      -I../../../../samples/html/test  -I../../../../samples/html/test/../../../samples -pthread -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -Wno-deprecated-declarations -O2 -I/usr/include/pango-1.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gtk-3.0/unix-print -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gio-unix-2.0 -I/usr/include/atk-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/webkitgtk-4.0 -I/usr/include/libsoup-2.4 -I/usr/include/libxml2 -fPIC -DPIC   -fPIC -DPIC   ../../../../samples/html/test/test.cpp
g++ -o test  test_test.o    -L~/wxWidgets-3.2.3/build-linux-x86_64/lib      -pthread  -lwx_gtk3u_html-3.2  -lwx_gtk3u_core-3.2  -lwx_baseu_net-3.2  -lwx_baseu-3.2        -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lgthread-2.0 -pthread -lglib-2.0 -lX11 -lSM -lxkbcommon -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -lharfbuzz -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lXtst -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lharfbuzz -lfontconfig -lfreetype -lpng -lz -ljpeg -ltiff -ljbig    -pthread    -lz -ldl -lm -lpcre2-32  -lz -ldl -lm
~/wxWidgets-3.2.3/build-linux-x86_64/samples/html/test$ ./test

image

vadz commented 11 months ago

The Chromebook linked (or loader?) must be using some optimization option which discards "unused" code registering HTML tags.

Can you try adding these lines to the main eXtrema (or even sample) file:

#include "wx/html/forcelnk.h"
FORCE_WXHTML_MODULES()

?

esternin commented 11 months ago

Added to samples/html/test/test.cpp, recompiled. No change. Tried putting FORCE_WXHTML_MODULES(); into OnInit(), no effect.

vadz commented 11 months ago

Sorry, really no idea then. Can you set up sshd on Chromebook and give me access to it? If so, perhaps I could try to debug it. But I don't know what to do without being able to reproduce it myself.

esternin commented 11 months ago

Since this does not seem to be our issue - wxWidgets Help example shows the same mis-behaviour, and only on Chromebook version of Debian+xWayland. Google must have tweaked something there.

Nothing to do: either Google Linux will get better, or the wxWidgets team will figure out a workaround.

Keep open until it's fixed upstream.