My progress in Wayland compatibility layer

Maybe not, but at least it might get us up and running in the meantime.

3 Likes

…wow… great… awesome :+1: :+1: :+1:

Source code [WIP]:

13 Likes

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.

POSIX have no API for creating anonymous memory files, but Linux (memfd_create) and BSD (shm_open(SHM_ANON, …)) extensions exists.

Workaround with using RAM disk:

ramdisk create -s 2G
mkfs -q -t bfs /dev/disk/virtual/ram/0/raw
mount /dev/disk/virtual/ram/0/raw /boot/system/var/shared_memory
18 Likes

Popup windows:

screenshot356

29 Likes

Haiku native window decorations with org_kde_kwin_server_decoration_manager protocol (xdg_decoration protocol is not supported by GTK).

GTK 3:

GTK 4:

33 Likes

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
7 Likes

Quick search mentions gtk-doc missing?

6 Likes

GTK WebKit:

31 Likes

But does HTTPS work? @3dEyes successfully built it before, but said HTTPS connections crashed. If those get fixed we could add GTKWebKit to HaikuPorts…

6 Likes

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.

27 Likes

Well, if you could submit a PR to HaikuPorts, we could get these fixes in and then @3dEyes could commit a recipe :slight_smile:

8 Likes

This problem is solved, but now there is another one - IPC (Unix sockets?) crashes. And because of regression in xlibe (after this commit - Set display depths based on the actual screen color space. · waddlesplash/xlibe@8eda2dc · GitHub) there are artifacts when WebKit gtk works (you can see on the screenshot).

11 Likes

It is also necessary to solve the possibility to install/build two gtk working through xlibe and wayland together.

6 Likes

Well, nobody reported this to me otherwise I would have investigated it :slight_smile:

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.

3 Likes

Crash reports? Does it look like a problem in glib, some missing feature in Haiku, or what?

3 Likes

So far created recipes (basic) for wayland/wayland-protocols/wayland-server (with the help from @X512 for the fixes)
Checked Gimp in Terminal with “autoreconf -vfi” no issue there, but for Gimp to work with gtk/wayland I guess I need to build gtk with the changes done from @X512

2 Likes

It’s not a server implementation at all, so naming is that is misleading.

In Wayland terminology it is a “server”. It use libwayland-server API. But run in the same process as client. So I call it “in-process Wayland server”. It can be adapted to run as real server in separate process if needed but it would cause various integration problems in Haiku, for example all windows will be displayed in Deskbar in Wayland server application instead of clients.

5 Likes

No, this problem is only for webkit gtk.
I can publish the recipe and the patch right now.

7 Likes