Adventures in Wayland

I’ve spent the last two weekends with the GTK+ Wayland backend, trying to make some progress towards day-to-day usability. While there are still some big gaps, things are looking pretty ok now.

Window decorationsThis screenshot shows client-side decorations on a GTK+ window. You can see rounded corners and invisible borders – shadows are still missing. We use the proper resize cursors, depending on which directions the window can be resized. This is a combined work of Kristian and Rob, based on older work by Cody Russell.

SettingsThis screenshot demonstrates that GTK+ applications are picking up desktop settings now – in this example the cursor theme as well as the text size.

The support for settings in GTK+ is a bit complicated: We have a GtkSettings object which receives changes from the xsettings client in the X backend. These xsettings are provided by the xsettings manager that is part of gnome-settings-daemon, which in turns reads the settings out of GSettings.

In Wayland, there is not root window to store properties on, and no X selection mechanism to manage it. In principle, the compositor could provide a settings interface for clients to use. Since we don’t have that yet, the GDK backend reads the settings directly out of GSettings for now. That works fine and fits the Wayland philosophy of doing things client-side.

Keyboard supportThis screenshot tries to capture some improvements of the keyboard support. Key repeat is done client-side and similar to the settings, we pick up the configuration for it directly from GSettings. Keyboard state information is propagated, and causes the Caps Lock warning icon to be shown in the password entry.

The Wayland backend should also handle keyboard layout changes, but since weston does not support changing layouts at runtime, this has not been tested.

The tooltip on that icon shows that there’s some work left to be done on popup window placement.

Custom titlebarsOnce we have client-side decorations, it becomes very natural to allow custom titlebars, like the one shown in this example. This has always been possible: you could use old-style wm hints to tell the window manager not to put a titlebar, and do your own. Using gtk_window_set_titlebar() just makes this easier, and it does the right thing, regardless whether you are using client-side decorations under Wayland or traditional wm decorations under X.

All of the screenshots are with current git master of GTK+. Trying out Wayland is pretty easy if you are on Fedora 19. The gtk3 package has the Wayland backend enabled. Just install weston, and set GDK_BACKEND=wayland.

To learn more about the status of the GTK+ Wayland backend and the work that remains to be done, visit the wiki page.

8 thoughts on “Adventures in Wayland”

  1. its nice to see progress with gtk+, it brings xfce on weston one step closer. keep up the good work!

  2. Does Wayland have a sensible concept of display size or scale, to make it easier to scale all UI elements?

  3. This is very encouraging. Despite the gaps, we know what they are and have a basic plan on how to fill them in, so I think Wayland will become a more compelling option for everyone very soon. Also, there are plenty of peripheral reasons to get excited about this- not the least of which is the possibility to run GNOME on devices with existing Android display drivers, such as tablets.

    Good luck with the more tricky problems on the way to full Wayland support.

  4. What would be the downside to using GtkSettings using GSettings directly on all platforms?

    1. It misses the point of XSettings, to share settings across desktop environments.
      If GTK+ apps use the GNOME settings stored in GSettings while running under KDE instead of picking up the KDE settings that are exported via XSettings, they will look and feel more foreign than they should.

Comments are closed.