![]() |
Pitfalls and known problems | ![]() |
Two copies of the Qt port. Plugins/Qt and
Plugins/Qt6
are maintained in parallel and synchronized by hand. A fix applied to one directory must be applied to the other; CMake and Qtwk use only the first, and configure --enable-qt-new (the default on Android) only the second.
What CMake builds. TEXMACS_GUI accepts Qt, Qt6, Qt5, Qt4, Vue, SDL and X11 (
CMakeLists.txt
, section “GUI & Qt Selection”). The
Plugins/Qt6
fork, Qtwk and Cocoa can only be built with configure, and a CMake build of Vue has a GPU renderer only when THORVG_DIR names a ThorVG build.
Qtwk passes for Qt in C++. Qtwk defines QTTEXMACS for its platform layer, and gui_version returns "qt5" or "qt6", although its widgets are those of Widkit: code which tests QTTEXMACS also applies to Qtwk unless it excludes QTWKTEXMACS. The run-time predicates do exclude it: gui_is_qt is false and gui_is_x true for Qtwk (
Kernel/Abstractions/basic.cpp
), so that Scheme treats it as X11 (no print dialog, a confirmation before overwriting a file).
Features reserved to some ports. Code which tests QTTEXMACS often has the Widkit code in its #else branch, and Scheme code offers many features only when qt-gui? holds (13 files of
TeXmacs/progs
), some of them also with vue-gui?. A new port has to review both, see porting TeXmacs to another toolkit. The color menus, for instance, open the native color picker only with qt-gui?, so Vue uses the Scheme picker.
Placeholder widgets. All ports define the 49 constructors of
widget.hpp
, but some definitions return a nil widget or a substitute (the overview): a tree_view_widget shows “Not implemented” in the Widkit ports, and ink_widget, empty_widget and wait_widget are nil in Qt and Cocoa.
Headless mode. Qt and Vue make no windows in this mode; SDL, X11 and Cocoa make them but never show them, and X11 still needs a display (xvfb-run on a machine without one). The windows of Qtwk do not test is_headless.
X11 selections are Latin-1. The X11 port only offers and requests the target STRING (
x_loop.cpp
,
x_gui.cpp
), never UTF8_STRING, so non Latin-1 text is not exchanged correctly with other programs, and since it offers a single string (plain text), a copy between two TeXmacs instances loses its structure. Pasting also busy-polls up to a million times for the answer of the selection owner (
x_gui.cpp
), using the processor meanwhile and failing with slow owners.
SDL and Vue on Linux. SDL has only the system clipboard, so the X11 PRIMARY selection ("mouse") is internal to TeXmacs in these two ports.
The WebAssembly build of Vue for the browser is in this tree (
misc/wasm
), see the Vue port. Its pitfalls are those of a page: no processes (plug-ins run as Web Workers), one canvas for all the windows, a loop which cannot block, a clipboard which the browser hands over only on a paste event or a gesture of the user, and files in a virtual file system kept in IndexedDB; see
docs/wasm/README.md
.