Recently I started implementing Wayland compatibility layer that allow to run Wayland based toolkits and applications such as GTK 3-4, potentially Chromium and Firefox. Unlike regular Wayland compositor, it have no server process and implementation is loaded as add-on of Wayland client process. Direct function calls are used instead of sockets. Approach is similar to Xlibe.
Architecture
Compatibility layer use modified libwayland code with stripped socket related logic added add-on mechanism. It provides API and ABI compatible libwayland-client.so library that allows to run Wayland applications without changes. Wayland server is implemented as add-on “wayland-server-inproc.so” (Wayland in-process server) that are loaded when establishing connection. Wayland in-proc server maps Wayland protocol calls into Haiku API, for example wl_surface_commit is mapped to BView::SetViewBitmap(), so no compositor is actually implemented, app_server drawing capabilities are used.
I made C++ code generator for Wayland interfaces based on existing C code generator to make code more readable and manageable.
Why?
Wayland support allows quick and high-quality port of GTK 3+ based applications and other Wayland applications. Xlibe is also an option but, X11 protocol is more complex and harder to implement properly. It also have a lot of cryptic behavior because of its age and uncoodinated extending. Wayland is easier to implement. Current Xlibe implementation have various drawing glitches like black flickering. X11 have multiple input protocols, multiple window manager protocols that are hard to fully implement. X11 is generally considered outdated in Linux ecosystem and it is planned to be retired in flavor of Wayland. GTK developers suggest dropping X11 backend in GTK 5 because of lack of backend developers: Consider dropping the X11 backend (#5004) · Issues · GNOME / gtk · GitLab.
GTK window resize and update in GTK 3 is currently very slow because Haiku don’t support memory files. Wayland use memory files for bitmap buffers and it is a part of public API. Haiku native shared memory API is area API (create_area etc.) that use its own area_id object identifiers instead of file descriptors so it is incompatible with Wayland. It is not only Wayland problem, but also many other *NIX based software that use shared memory.
Currently regular files on disk are used and it works well in many situations because of RAM file cache, but when file is unmapped Haiku kernel flush file contents on disk that is terribly slow and not needed because file is unlinked immediately after creation.
Memory file kernel module is needed to fully solve problem. It can create anonymous files with control device ioctl() so file will have inode only, but not name. vfs_set_vnode_cache() kernel API and VMAnonymousCache can be use for implementation.
It is likely already possible to run GIMP with GTK 3 Wayland, but GIMP use Autotools build system that if far beyond my understanding. So I give up. Existing GIMP binary do not run with GTK 3 Wayland libraries because of dynamic linker errors.
/Haiku/data/packages/haikuports/media-gfx/gimp/work-2.99.8/sources/gimp-2.99.8> autoreconf -f -i
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4macros'.
libtoolize: copying file 'm4macros/libtool.m4'
libtoolize: copying file 'm4macros/ltoptions.m4'
libtoolize: copying file 'm4macros/ltsugar.m4'
libtoolize: copying file 'm4macros/ltversion.m4'
libtoolize: copying file 'm4macros/lt~obsolete.m4'
configure.ac:490: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:490: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:490: the top level
configure.ac:493: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:493: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:493: the top level
configure.ac:500: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:500: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:500: the top level
configure.ac:503: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:503: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:503: the top level
configure.ac:506: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:506: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:506: the top level
configure.ac:509: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:509: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:509: the top level
configure.ac:512: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:512: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:512: the top level
configure.ac:515: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:515: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:515: the top level
configure.ac:518: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:518: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:518: the top level
configure.ac:521: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:521: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:521: the top level
configure.ac:524: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:524: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:524: the top level
configure.ac:527: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:527: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:527: the top level
configure.ac:530: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:530: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:530: the top level
configure.ac:533: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:533: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:533: the top level
configure.ac:536: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:536: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:536: the top level
configure.ac:548: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:548: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:548: the top level
configure.ac:551: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:551: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:551: the top level
configure.ac:618: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:618: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:618: the top level
configure.ac:620: warning: The macro `AC_HEADER_TIME' is obsolete.
configure.ac:620: You should run autoupdate.
./lib/autoconf/headers.m4:743: AC_HEADER_TIME is expanded from...
configure.ac:620: the top level
configure.ac:670: warning: The macro `GLIB_GNU_GETTEXT' is obsolete.
configure.ac:670: You should run autoupdate.
aclocal.m4:604: GLIB_GNU_GETTEXT is expanded from...
aclocal.m4:704: AM_GLIB_GNU_GETTEXT is expanded from...
configure.ac:670: the top level
configure.ac:670: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:670: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
aclocal.m4:289: GLIB_LC_MESSAGES is expanded from...
aclocal.m4:604: GLIB_GNU_GETTEXT is expanded from...
aclocal.m4:704: AM_GLIB_GNU_GETTEXT is expanded from...
configure.ac:670: the top level
configure.ac:670: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:670: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/headers.m4:89: _AC_CHECK_HEADER_COMPILE is expanded from...
./lib/autoconf/headers.m4:56: AC_CHECK_HEADER is expanded from...
aclocal.m4:388: GLIB_WITH_NLS is expanded from...
aclocal.m4:604: GLIB_GNU_GETTEXT is expanded from...
aclocal.m4:704: AM_GLIB_GNU_GETTEXT is expanded from...
configure.ac:670: the top level
configure.ac:670: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:670: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/headers.m4:89: _AC_CHECK_HEADER_COMPILE is expanded from...
./lib/autoconf/headers.m4:56: AC_CHECK_HEADER is expanded from...
aclocal.m4:388: GLIB_WITH_NLS is expanded from...
aclocal.m4:604: GLIB_GNU_GETTEXT is expanded from...
aclocal.m4:704: AM_GLIB_GNU_GETTEXT is expanded from...
configure.ac:670: the top level
configure.ac:670: warning: The macro `AC_OUTPUT_COMMANDS' is obsolete.
configure.ac:670: You should run autoupdate.
./lib/autoconf/status.m4:1025: AC_OUTPUT_COMMANDS is expanded from...
aclocal.m4:388: GLIB_WITH_NLS is expanded from...
aclocal.m4:604: GLIB_GNU_GETTEXT is expanded from...
aclocal.m4:704: AM_GLIB_GNU_GETTEXT is expanded from...
configure.ac:670: the top level
configure.ac:1070: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:1070: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:1070: the top level
configure.ac:1071: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:1071: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:1071: the top level
configure.ac:1086: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:1086: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:1086: the top level
configure.ac:1115: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:1115: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:1115: the top level
configure.ac:1129: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:1129: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:1129: the top level
configure.ac:1169: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:1169: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/detectcflags.m4:4: GIMP_DETECT_CFLAGS is expanded from...
configure.ac:1169: the top level
configure.ac:2164: warning: The macro `AC_LANG_C' is obsolete.
configure.ac:2164: You should run autoupdate.
./lib/autoconf/c.m4:72: AC_LANG_C is expanded from...
m4macros/alsa.m4:15: AM_PATH_ALSA is expanded from...
configure.ac:2164: the top level
configure.ac:2164: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:2164: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
m4macros/alsa.m4:15: AM_PATH_ALSA is expanded from...
configure.ac:2164: the top level
configure.ac:267: installing './compile'
configure.ac:108: installing './missing'
app-tools/Makefile.am: installing './depcomp'
gtk-doc.make:25: error: GTK_DOC_USE_LIBTOOL does not appear in AM_CONDITIONAL
devel-docs/app/Makefile.am:115: 'gtk-doc.make' included from here
gtk-doc.make:79: error: GTK_DOC_BUILD_HTML does not appear in AM_CONDITIONAL
devel-docs/app/Makefile.am:115: 'gtk-doc.make' included from here
gtk-doc.make:84: error: GTK_DOC_BUILD_PDF does not appear in AM_CONDITIONAL
devel-docs/app/Makefile.am:115: 'gtk-doc.make' included from here
gtk-doc.make:303: error: HAVE_GTK_DOC does not appear in AM_CONDITIONAL
devel-docs/app/Makefile.am:115: 'gtk-doc.make' included from here
gtk-doc.make:25: error: GTK_DOC_USE_LIBTOOL does not appear in AM_CONDITIONAL
devel-docs/libgimp/Makefile.am:81: 'gtk-doc.make' included from here
gtk-doc.make:79: error: GTK_DOC_BUILD_HTML does not appear in AM_CONDITIONAL
devel-docs/libgimp/Makefile.am:81: 'gtk-doc.make' included from here
gtk-doc.make:84: error: GTK_DOC_BUILD_PDF does not appear in AM_CONDITIONAL
devel-docs/libgimp/Makefile.am:81: 'gtk-doc.make' included from here
gtk-doc.make:303: error: HAVE_GTK_DOC does not appear in AM_CONDITIONAL
devel-docs/libgimp/Makefile.am:81: 'gtk-doc.make' included from here
gtk-doc.make:25: error: GTK_DOC_USE_LIBTOOL does not appear in AM_CONDITIONAL
devel-docs/libgimpbase/Makefile.am:61: 'gtk-doc.make' included from here
gtk-doc.make:79: error: GTK_DOC_BUILD_HTML does not appear in AM_CONDITIONAL
devel-docs/libgimpbase/Makefile.am:61: 'gtk-doc.make' included from here
gtk-doc.make:84: error: GTK_DOC_BUILD_PDF does not appear in AM_CONDITIONAL
devel-docs/libgimpbase/Makefile.am:61: 'gtk-doc.make' included from here
gtk-doc.make:303: error: HAVE_GTK_DOC does not appear in AM_CONDITIONAL
devel-docs/libgimpbase/Makefile.am:61: 'gtk-doc.make' included from here
gtk-doc.make:25: error: GTK_DOC_USE_LIBTOOL does not appear in AM_CONDITIONAL
devel-docs/libgimpcolor/Makefile.am:54: 'gtk-doc.make' included from here
gtk-doc.make:79: error: GTK_DOC_BUILD_HTML does not appear in AM_CONDITIONAL
devel-docs/libgimpcolor/Makefile.am:54: 'gtk-doc.make' included from here
gtk-doc.make:84: error: GTK_DOC_BUILD_PDF does not appear in AM_CONDITIONAL
devel-docs/libgimpcolor/Makefile.am:54: 'gtk-doc.make' included from here
gtk-doc.make:303: error: HAVE_GTK_DOC does not appear in AM_CONDITIONAL
devel-docs/libgimpcolor/Makefile.am:54: 'gtk-doc.make' included from here
gtk-doc.make:25: error: GTK_DOC_USE_LIBTOOL does not appear in AM_CONDITIONAL
devel-docs/libgimpconfig/Makefile.am:60: 'gtk-doc.make' included from here
gtk-doc.make:79: error: GTK_DOC_BUILD_HTML does not appear in AM_CONDITIONAL
devel-docs/libgimpconfig/Makefile.am:60: 'gtk-doc.make' included from here
gtk-doc.make:84: error: GTK_DOC_BUILD_PDF does not appear in AM_CONDITIONAL
devel-docs/libgimpconfig/Makefile.am:60: 'gtk-doc.make' included from here
gtk-doc.make:303: error: HAVE_GTK_DOC does not appear in AM_CONDITIONAL
devel-docs/libgimpconfig/Makefile.am:60: 'gtk-doc.make' included from here
gtk-doc.make:25: error: GTK_DOC_USE_LIBTOOL does not appear in AM_CONDITIONAL
devel-docs/libgimpmath/Makefile.am:46: 'gtk-doc.make' included from here
gtk-doc.make:79: error: GTK_DOC_BUILD_HTML does not appear in AM_CONDITIONAL
devel-docs/libgimpmath/Makefile.am:46: 'gtk-doc.make' included from here
gtk-doc.make:84: error: GTK_DOC_BUILD_PDF does not appear in AM_CONDITIONAL
devel-docs/libgimpmath/Makefile.am:46: 'gtk-doc.make' included from here
gtk-doc.make:303: error: HAVE_GTK_DOC does not appear in AM_CONDITIONAL
devel-docs/libgimpmath/Makefile.am:46: 'gtk-doc.make' included from here
gtk-doc.make:25: error: GTK_DOC_USE_LIBTOOL does not appear in AM_CONDITIONAL
devel-docs/libgimpmodule/Makefile.am:55: 'gtk-doc.make' included from here
gtk-doc.make:79: error: GTK_DOC_BUILD_HTML does not appear in AM_CONDITIONAL
devel-docs/libgimpmodule/Makefile.am:55: 'gtk-doc.make' included from here
gtk-doc.make:84: error: GTK_DOC_BUILD_PDF does not appear in AM_CONDITIONAL
devel-docs/libgimpmodule/Makefile.am:55: 'gtk-doc.make' included from here
gtk-doc.make:303: error: HAVE_GTK_DOC does not appear in AM_CONDITIONAL
devel-docs/libgimpmodule/Makefile.am:55: 'gtk-doc.make' included from here
gtk-doc.make:25: error: GTK_DOC_USE_LIBTOOL does not appear in AM_CONDITIONAL
devel-docs/libgimpthumb/Makefile.am:55: 'gtk-doc.make' included from here
gtk-doc.make:79: error: GTK_DOC_BUILD_HTML does not appear in AM_CONDITIONAL
devel-docs/libgimpthumb/Makefile.am:55: 'gtk-doc.make' included from here
gtk-doc.make:84: error: GTK_DOC_BUILD_PDF does not appear in AM_CONDITIONAL
devel-docs/libgimpthumb/Makefile.am:55: 'gtk-doc.make' included from here
gtk-doc.make:303: error: HAVE_GTK_DOC does not appear in AM_CONDITIONAL
devel-docs/libgimpthumb/Makefile.am:55: 'gtk-doc.make' included from here
gtk-doc.make:25: error: GTK_DOC_USE_LIBTOOL does not appear in AM_CONDITIONAL
devel-docs/libgimpwidgets/Makefile.am:85: 'gtk-doc.make' included from here
gtk-doc.make:79: error: GTK_DOC_BUILD_HTML does not appear in AM_CONDITIONAL
devel-docs/libgimpwidgets/Makefile.am:85: 'gtk-doc.make' included from here
gtk-doc.make:84: error: GTK_DOC_BUILD_PDF does not appear in AM_CONDITIONAL
devel-docs/libgimpwidgets/Makefile.am:85: 'gtk-doc.make' included from here
gtk-doc.make:303: error: HAVE_GTK_DOC does not appear in AM_CONDITIONAL
devel-docs/libgimpwidgets/Makefile.am:85: 'gtk-doc.make' included from here
autoreconf: error: automake failed with exit status: 1
But does HTTPS work? @3dEyes successfully built it before, but said HTTPS connections crashed. If those get fixed we could add GTKWebKit to HaikuPorts…
Yes, HTTPS is working. The problem was in gnutls with TLS variable usage. Fixed by removing static from TLS variable declaration. Maybe some Haiku-specific GCC configuration is wrong.
Well, nobody reported this to me otherwise I would have investigated it
Does it happen with any other GTK applications? It will not be easy for me to test otherwise as there still isn’t any GTKWebKit recipe…
You can try reverting just the change to the vlist[0].bits_per_rgb line and leave the other changes from that commit intact, see if that fixes the problem.