Wayland compositor experiments

Limitations of the Qt-based wayland compositor build into lipstick are a recurring theme and many workarounds have been created like qt-runner. A more sustainable solution was discussed recently:

  • remove the compositor from lipstick and use an existing one like weston or sway or phoc or …
  • replace the Qt compositor in lipstick with wlroots

Apparently someone at Jolla got weston running in his holidays but no code was provided. So I started trying the same. My knowledge on all topics involved is quite limited so I would like to invite you to learn and grow together with me. I’ll try to turn this first post into a wiki and invite you to help.

Possible rewards:

  • simplify executing apps based on newer Qt
  • package and run GTK based apps (lot’s of packaging …)
  • Flatpak for things like mobile-config Firefox …

Status:

  • Weston and dependencies packaged
  • sway almost packaged, systemd is one version too old, might be patchable
  • weston crashes with wayland backend as libstick (somewhat expected)
  • I don’t know how to start weston standalone

Todo:

  • Document how to hack on this
  • Clean up packaging
  • get weston to run
  • get lipstick to run inside weston/as a shell/???
  • recreate lipstick gestures etc in weston plugin (?)

Links:

Summary of the idea in Community News:

Repository on obs:

Packaging on github:

Lipstick (Compositor & Homescreen):

15 Likes

I have no clue about that, but read on the English telegram group about Plasma Mobile. Couldn’t be an alternative? Ping @dubstar_04

1 Like

How to hack on this (afaik …):

Real Device (aarch64):

zypper ar https://repo.sailfishos.org/obs/home:/simonschmeisser:/wayland/sailfish_latest_aarch64/home:simonschmeisser:wayland.repo
zypper ref
zypper install weston

or simulator

#start simulator in QtCreator
ssh defaultuser@localhost -p 2223 -i ~/SailfishOS/vmshare/ssh/private_keys/sdk 

sudo su
pkcon in zypper
zypper ar https://repo.sailfishos.org/obs/home:/simonschmeisser:/wayland/sailfish_latest_i486/home:simonschmeisser:wayland.repo
zypper ref
zypper install weston

Try to run it in windowed mode:

weston

run it “standalone”:

unset WAYLAND_DISPLAY
weston

I don’t know how to run it properly, so I hacked the lipstick systemd file:

zypper in vim
vim /usr/lib/systemd/user/lipstick.service

ExecStart=weston -B drm

systemctl daemon-reload
reboot

which gives me this in journalctl

Dec 27 16:19:51 SailfishEmul systemd[431]: Starting The lipstick UI...
Dec 27 16:19:51 SailfishEmul weston[684]: Date: 2025-12-27 EET
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.219] weston 14.0.2
Dec 27 16:19:51 SailfishEmul weston[684]:                https://wayland.freedesktop.org
Dec 27 16:19:51 SailfishEmul weston[684]:                Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
Dec 27 16:19:51 SailfishEmul weston[684]:                Build: 14.0.2
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.219] Command line: /usr/bin/weston -B drm
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.219] OS: Linux, 5.0.21-1.4.2.jolla, #1 SMP PREEMPT Thu Feb 6 20:11:51 UTC 2025, i686
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.219] Flight recorder: enabled
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.219] Starting with no config file.
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.219] Output repaint window is 7 ms maximum.
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.220] Loading module '/usr/lib/libweston-14/drm-backend.so'
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.221] initializing drm backend
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.221] Trying libseat launcher...
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.221] [libseat/backend/seatd.c:64] Could not connect to socket /run/seatd.sock: No such file or directory
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.221] [libseat/libseat.c:76] Backend 'seatd' failed to open seat, skipping
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.225] [libseat/libseat.c:73] Seat opened with backend 'logind'
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.226] libseat: session control granted
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.227] using /dev/dri/card0
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.228] DRM: supports atomic modesetting
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.228] DRM: does not support GBM modifiers
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.228] DRM: does not support Atomic async page flip
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.228] DRM: supports picture aspect ratio
Dec 27 16:19:51 SailfishEmul weston[684]: pci id for fd 13: 80ee:beef, driver (null)
Dec 27 16:19:51 SailfishEmul weston[684]: MESA-LOADER: failed to open vboxvideo: /usr/lib/dri/vboxvideo_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/dri, suffix _dri)
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.238] Loading module '/usr/lib/libweston-14/gl-renderer.so'
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.240] warning: failed to query rendering device from EGL
Dec 27 16:19:51 SailfishEmul weston[684]: [16:19:51.240] EGL version: 1.5
Dec 27 16:19:51 SailfishEmul systemd[431]: lipstick.service: Failed with result 'exit-code'.
Dec 27 16:19:51 SailfishEmul systemd[431]: Failed to start The lipstick UI.
Dec 27 16:19:52 SailfishEmul systemd[431]: lipstick.service: Start request repeated too quickly.
Dec 27 16:19:52 SailfishEmul systemd[431]: lipstick.service: Failed with result 'exit-code'.

2 Likes

Plasma Mobile uses kwin and would be a good approach if Sailfish OS had a recent Qt version. KDE people love bumping version requirements which is fine because you can fix bugs at the root package/library and not have workarounds everywhere. But it’s hard to keep pace for jolla/us.

2 Likes

It would be interesting to get a wlroots-based compositor running instead of Weston. Maybe things have changed by now, but a few years ago Weston seemed like a dead end. There are a lot of different compositors based on wlroots and it seems to be very flexible. I can try building a simple one for testing purposes.

There is also a fork of wlroots for devices using libhybris: GitHub - droidian/wlroots: A modular Wayland compositor library.

8 Likes

pardon my spitballing; but shouldnt weston use the vendor-specific egl? You might need to preload it..

2 Likes

On PinePhone I get:

Dez 27 16:58:19 PinePhone weston[2933]: [16:58:19.017] GL ES 2.0 - renderer features:
Dez 27 16:58:19 PinePhone weston[2933]:                read-back format: ARGB8888
Dez 27 16:58:19 PinePhone weston[2933]:                glReadPixels supports y-flip: yes
Dez 27 16:58:19 PinePhone weston[2933]:                glReadPixels supports PBO: yes
Dez 27 16:58:19 PinePhone weston[2933]:                wl_shm 10 bpc formats: no
Dez 27 16:58:19 PinePhone weston[2933]:                wl_shm 16 bpc formats: no
Dez 27 16:58:19 PinePhone weston[2933]:                wl_shm half-float formats: no
Dez 27 16:58:19 PinePhone weston[2933]:                internal R and RG formats: yes
Dez 27 16:58:19 PinePhone weston[2933]:                OES_EGL_image_external: yes
Dez 27 16:58:19 PinePhone weston[2933]: [16:58:19.018] Using GL renderer
Dez 27 16:58:19 PinePhone weston[2933]: [16:58:19.183] event2  - not using input device '/dev/input/event2'
Dez 27 16:58:19 PinePhone weston[2933]: [16:58:19.207] event3  - not using input device '/dev/input/event3'
Dez 27 16:58:19 PinePhone weston[2933]: [16:58:19.239] event1  - not using input device '/dev/input/event1'

Dez 27 16:58:19 PinePhone weston[2933]: [16:58:19.267] event0  - not using input device '/dev/input/event0'
Dez 27 16:58:19 PinePhone weston[2933]: [16:58:19.303] event4  - not using input device '/dev/input/event4'
Dez 27 16:58:19 PinePhone weston[2933]: [16:58:19.343] event5  - not using input device '/dev/input/event5'
Dez 27 16:58:19 PinePhone weston[2933]: [16:58:19.343] warning: no input devices on entering Weston. Possible causes:
Dez 27 16:58:19 PinePhone weston[2933]:         - no permissions to read /dev/input/event*
Dez 27 16:58:19 PinePhone weston[2933]:         - seats misconfigured (Weston backend option 'seat', udev device property ID_SEAT)
Dez 27 16:58:19 PinePhone weston[2933]: [16:58:19.343] failed to create input devices
Dez 27 16:58:19 PinePhone weston[2933]: [16:58:19.347] fatal: failed to create compositor backend
Dez 27 16:58:19 PinePhone weston[2933]: Internal warning: debug scope 'drm-backend' has not been destroyed.
Dez 27 16:58:19 PinePhone systemd[2855]: lipstick.service: Main process exited, code=exited, status=1/FAILURE
Dez 27 16:58:19 PinePhone systemd[2855]: lipstick.service: Failed with result 'exit-code'.

Do you have some more details? Sounds like a reasonable point :+1:

1 Like

some good info here:

1 Like

id say LD_PRELOAD should help

1 Like

I was able to get the tinywl.c example running with the wlroots package from the repository, but it seems to be of very limited use because wl_shell is no longer implemented and Qt 5.6 apps don’t support the xdg_shell protocol yet. We need a new Qt version for this to work.

The other option would be to reintroduce wl_shell support. It was removed back in 2019 from wlroots, and more recently from weston.

1 Like

Someone already tried to develop a new compositor.
newcompositor | OpenRepos.net — Community Repository System and his repository GitHub - ArturGaspar/newcompositor

2 Likes

Can you please add as many details as possible how you did it? Especially how to actually start it.

Shouldn’t be too hard to reintroduce wl_shell I hope?

1 Like
# zypper in wlroots-devel
$ mkdir tinywl
$ cd tinywl
$ wget https://gitlab.freedesktop.org/wlroots/wlroots/-/raw/0.19/tinywl/Makefile
$ wget https://gitlab.freedesktop.org/wlroots/wlroots/-/raw/0.19/tinywl/tinywl.c
$ make
$ systemctl stop --user lipstick # retry if this fails
$ LIBSEAT_BACKEND=noop WLR_BACKENDS=drm,libinput ./tinywl

This should show a black screen. I only tested it on a Jolla C2 with the mainline kernel, but I expect this to work in the simulator too.

4 Likes

Maybe this is also worth testing/looking into besides wlroots.

I’ve started working on an experimental compositor: affenull2345/compositor-experiment - Codeberg.org

It is not packaged yet and neither is it usable without a corresponding window manager application, but that is coming soon.

14 Likes

@simonschmeisser did LD_PRELOAD make any difference in your logs?

Okay, here is an example window manager client: affenull2345/windowmanager-example - Codeberg.org

This is not going as well as I expected, since the wlroots scene graph API is quite limited. For instance, it’s not possible to render windows with rounded corners using it. This means that custom rendering code is needed.

I also had a look at Jolla’s proprietary sailfish-compositor (for those who didn’t notice, it is available as a package in the main jolla repository). It doesn’t use wlroots or anything similar and appears to do the rendering with Qt and some custom OpenGL code. It implements the new xdg_shell protocol too. I hope Jolla can open-source this, it does look quite promising.

9 Likes