Greenfield is a Wayland compositor that runs in the browser. This allows to display Wayland capable applications directly in the browser.
The test environment consisted of an ARM Ubuntu VM running macOS as shown in the graphic above. In the Ubuntu VM the Compositor Module is started first. If a Wayland compositor is already running under Ubuntu, it will open a second socket. This means that programs which are started then must have the WAYLAND_DISPLAY Enviroment variable set to wayland-1 (default would be wayland-0). Alternatively the XDG_RUNTIME_DIR can be changed before.
Next, the compositor proxy must be started. However, if we do not want to call the Compositor Proxy under Ubuntu, we have to set the IP address of the Ubuntu VM. For this, the proxyHost must be changed to the IP address of the VM.
This can be changed in the file compositor-module/demo-compositor/src/index.ts. (Default here is localhost)
Afterwards the Compositor Proxy can be started.
In the browser under Mac you can now access the Compositor with the IP address with port 8080.
In the Compositor Proxy a connection with the Compositor Module must be started.
Afterwards a wayland application can be started under Ubuntu and is then visible in the browser under macOS and can also be operated. For this example I programmed a simple HelloWorld in Qt/QMl and started it with -platform wayland.
What doesn’t work yet is restarting the Wayland application after closing it. For this I always had to restart the compositor. But the idea for this project and what it can do already is pretty cool!
If you want to test the whole thing, you can find the source code at: Github Greenfield Licence: AGPL-3.0
Official website: Greenfield.app