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


[Home] [TitleIndex] [WordIndex

Full Wayland support in GTK+

GTK+ already has a functional Wayland backend, but several pieces of functionality need to be completed before it is ready for prime time.

Many of the issues listed here apply to the clutter Wayland backend as well.

Also see the "Known Issues" section in Waylands own GTK+ documentation.

How to try GTK+ under Wayland

Fedora

In Fedora 19, GTK+ has been built with Wayland and X11 support, so all you need to try it is a Wayland compositor. Weston, the reference Wayland compositor, is available in the weston package.

$ yum install weston
$ weston &

This will run weston as an X client. clicking on the terminal icon in the weston panel will give you a terminal window. Inside there, you can run GTK+ applications like this:

$ GDK_BACKEND=wayland
$ export GDK_BACKEND
$ gtk3-demo

Client-side decorations

Under Wayland, it is preferred that clients render their own window decorations. Since gnome-shell will need to keep support for decorating X clients, it would be good if GTK+ and gnome-shell could share the css theming.

The goal here is to recreate the Adwaita-style decorations, including

Another goal we want to achieve with client-side decorations is to allow application controls in the titlebar, such as Previous/Next buttons for assistants, or Close buttons for dialogs.

Initial support for this has been developed in bug 694381 and committed. Some more work is needed.

Tasks here:

Copy/Paste support

The GTK+ APIs for this are spread out over GdkSelection, GtkSelection and GtkClipboard. Both GdkSelection and GtkSelection are closely tied to the way selections work in X. GtkClipboard should be the cross-platform abstraction for copy/paste that can be supported under Wayland.

Relevant Wayland interfaces: wl_data_device_manager, wl_data_offer, wl_data_source Relevant bug: #672358

Tasks here:

Drag-and-Drop support

The DND protocol in Wayland is similar to what GTK+ already supports. It should be possible to add Wayland support without changing APIs.

Relevant Wayland interfaces: wl_data_device_manager, wl_data_device

Tasks here:

Popups and grabs

Wayland does not have explicit grabs. GTK+ commonly uses grabs when showing override-redirect windows that want exclusive control of the pointer. Instead, Wayland has a concept of popup windows that get hidden automatically when they 'lose' the pointer. Representing this concept in GTK+ will require some API changes.

For now, the Wayland backend is working using heuristics to use popups when appropriate, which makes menus and combo box popups mostly work.

Tasks here:

Window positioning

Another problem with the GTK+ APIs around override-redirect windows is that Wayland does not give clients access to window positions, so the positioning callbacks that are used e.g. in gtk_menu_popup() won't work anymore.

A Wayland API for positioning windows has been proposed here: http://lists.freedesktop.org/archives/wayland-devel/2013-February/007340.html

Tasks here:

Keyboard layouts

The keymap support in the Wayland backend is greatly improved in 3.9. Most important pieces of functionality have been implemented now:

Weston does not support changing keyboard layouts at runtime, so this functionality has not been tested.

Tasks here:

Input methods

Support the Wayland text protocol. 698307

XSettings

The XSettings support in the Wayland backend is rudimentary. The supported settings are just hardwired to default values. XSettings was not a great success story in terms of adoption by other environments. One possible way forward would be to just drop the concept and instead port GtkSettings to use !GSettings directly. Alternatively, a simple interface could be provided by the compositor for these settings.

For now, the Wayland backend has been changed to use GSettings directly, when available.

Tasks here:

Frame synchronization

GTK+ recently gained support for frame synchronization with the compositor. This is implemented under X using a pair of XSync counters. Equivalent Wayland functionality has been implemented in the GDK backend in 3.9.

Tasks here:

Miscellaneous


2024-10-23 11:17