This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

GNOME Shell under Wayland

History

  1. In 2011 NeilRoberts and RobertBragg adapted Mutter as a proof of concept to be able to run the Clutter/MX based Dawati Shell (a shell aimed at Netbooks) as a hybrid X and Wayland compositor. We presented this at Fosdem2012. As Intermediate steps we also created two simple standalone compositors before making any changes to Mutter:

    1. We wrote a trivial Cogl based compositor (Cogland that let us test the Cogl integration we required but without any support for input or high-level shell functionality)

    2. We wrote a trivial Clutter based compositor test-wayland-surface (Now called Clayland) that let us test the Clutter integration we required without the added complexity of Mutter itself.
  2. In the summer of 2012 we built on that work further so that we could also show GnomeShell running as a hybrid Wayland compositor and we demonstrated that at Guadec 2012. Some of the patches for this work are attached to bug #671741. Up until this point we were based on the 0.85 Wayland protocol.

  3. We are now looking at updating our proof of concept work to work with the latest 1.x Wayland protocols to a level of quality that allows distributions to start shipping the software. By 3.10 we'd like users to be able to optionally choose to run GnomeShell as a hybrid Wayland compositor and by 3.12 we'd like this to be the only mode of operation.

Development Plan

There are currently two main tracks involved in enabling Wayland support in GnomeShell:

Bootstrapping wayland client support

The first step here is to enable running GnomeShell as a nested X11 application with support for connecting Wayland clients so that toolkit development can switch asap to testing against GnomeShell instead of Weston. The priority here is enabling others to make progress in parallel with the GnomeShell development. This should help us discover the functionality gaps that may require custom wayland protocol extensions for example.

System integration

Solve the system integration issues that were ignored during the initial prototyping work. Most importantly this means that the GnomeShell shouldn't require root privileges and it should be possible to launch GnomeShell as a Wayland compositor from GDM. This also implies controlling the display hardware via KMS.

Bootstrapping wayland client support

Currently NeilRoberts is focusing on this track. The first step has been to update Cogland to the 1.x protocol (done) and now Clayland is also being updated. This code will then largely copy across directly to Mutter. The patches here: #671741 will form the basis for this update.

In particular the following patches will likely be folded into a single 'Add Initial Wayland Client Support' patch:

a0d9c2b configure: Adds --with-xwayland-path option
5795d5d wayland: Adds basic hybrid X + Wayland support
23aebbb wayland: Add basic mouse input support
3107368 wayland: Add keyboard support
926f378 wayland: Install a device manager
257ac97 wayland: Add support for translating Clutter scroll events

While updating this work the plan is to avoid the use of #ifdefs to conditionally enable hybrid Wayland support and instead aim to have runtime control over what mode Mutter runs in. This should allow us to avoid shipping multiple versions of Mutter and GnomeShell for 3.10.

Details on testing this patchset can be found in the /Testing page.

System integration

Launcher

The first aim here is to avoid needing to run the compositor as root and the plan is to use a similar mechanism to weston-launch to enable us to isolate the code needing privileges from the complexity of Mutter + GnomeShell.

So far I've used some of the weston-launch code as a starting point and have created a tiny libvts (Lib Virtual Terminal Session) api that I aim to use to write a launcher for GnomeShell. There are a few differences compared to the current weston-launch program:

Display handling

Cogl already has a libgbm + KMS based winsys which we used for our earlier prototyping but this will need further development.

One aspect of this work is that we plan to extend the CoglOutput api to allow Cogl applications to query more information about display outputs with a portable api. In addition to querying more information about outputs we may expose some display configuration and overlay support via this api too, but we will also maintain an escape hatch for applications (including mutter potentially) to directly access KMS if useful.

GDM session launching

GDM is the gnome login manager, which is responsible for authenticating users via the PAM api, opening a new PAM session once authenticated and launching a user specified session program. The PAM "conversation" used to authenticate a user is done by talking to a login screen that is implemented using GnomeShell running under X11.

Currently GDM assumes that the user's session program wants an X server to run and it actually re-purposes the X server that's running for the login screen for the user's session program. For 3.10 we are assuming that we will continue to use an X11 based login screen for simplicity.

Since we now want to be be able to launch programs that don't need an X server we need to make some tweaks to how GDM sets up PAM before opening a session. To start with we can introduce a property for /usr/share/xsessions/xyz.desktop files that declares that the session doesn't require X and avoiding setting PAM_XDISPLAY and PAM_XAUTHDATA data. This should ensure that when PAM issues a CreateSession dbus request to logind then the systemd session will have a type of "tty" instead of "x11". When GDM sees that new session we can then make sure it checks the type to determine if it should re-use the existing X server. Beyond that we may need to extend the PAM and CreateSession api to be able to associate wayland specific authentication information with the session.

RayStrode has written a good overview of the issues related to GDM here

Open Issues


2024-10-23 11:17