Open ibnesayeed opened 5 years ago
Thanks for document this, @ibnesayeed. For my own self-reference, this would allow a Linux (or Mac/Windows) user that used Docker to access WAIL using their web browser instead of VNC. In @ibnesayeed's experiments, gedit and the native calculator app worked well and looked way better than WAIL does in its current Docker configuration. This may be due to the default windowing system in the Ubuntu basis image configuration.
This did not go smoothly with apps like Gimp and Evince (Linux's PDF viewer). When we tried it with WAIL per above by running these commands when logged into the container and manually installing the dependencies, the DISPLAY mapping did not seem to work. More details on this to come as I get time to try it out.
EDIT: @ibnesayeed has since been able to get Evince to work.
Similar to GDK, for QT-based applications there is something called WebGL Streaming.
Revised commands from the above adapted for WAIL execution:
$ docker container run -v ${PWD}:/wail -w="/wail" -e "TZ=Europe/Minsk" --rm -it -p 8085:8085 ubuntu bash
# apt update && apt install -y libgtk-3-bin apt-file libgtk-3-0 libnotify4 libsdl1.2debian libsm6 libxxf86vm1 python3 python3-pip
# pip3 install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-18.04 wxPython==4.0.4 && pip3 install pyinstaller==3.4
# pip3 install -r requirements.txt
# pyinstaller -p bundledApps ./bundledApps/WAIL.py --onefile --windowed --clean && mv /wail/dist/WAIL /wail/WAIL
# broadwayd :5 &
# GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 ./WAIL
This still returns:
User likely has the binary in the wrong location.
Unable to access the X Display, is $DISPLAY set properly?
as with the experiments with @ibnesayeed but the above should be replicable with respect to WAIL, as extracted from the Dockerfile.
I have a feeling that wxPython
is by default using QT-based UI components in this situation, but I am not too sure.
I tried docker container run -v ${PWD}:/wail -w="/wail" -e "TZ=Europe/Minsk" -e "DISPLAY=:0" --rm -it -p 8085:8085 ubuntu bash
with the same result.
I was under the impression that wxWidgets (and presumably wxPython) were using GTK under the hood. I may have to look into it more and maybe create a more fundamental example exhibiting this behavior before asking the wxPython community. (Unless @RobinD42 can chime in).
wxPython/wxWidgets does use GTK by default. My understanding is that wxWidgets can be built to support broadway as the GTK backend, although last I checked not all features were available in that mode. It would take some work to get wxPython to support a broadway version of wxWidgets as there are a few places that assume that x11 is being used, and also that all required wxWIdgets features are always available. So although it's not supported currently, it should be doable.
Thanks @RobinD42, this was very informative. At least now we know that some UI libraries have an assumption that X11 must be available in Linux environment. This explains why some seemingly GTK-based applications were failing to run.
Here is an experiment to run GNONE Calculator using the native GTK to HTML5 transformation.
In a web browser open http://localhost:8085/
EDIT (by MK), screenshot of gcalc: