Qt Wayland Compositor

Wayland is a display server protocol to help in creating multi-process systems, where multiple client applications may render content on the same display, by going via a compositor process.

Compared to a system with a single-process design, a multi-process system gives several benefits:

  • Easier resource management, through the regular operating system mechanisms.
  • Better security, as each application can run with its own permissions or sandbox.
  • Clearer separation of application UI and compositor UI, so each can be modified independently.

In a typical Wayland-based system, multiple client processes will render their own contents to off-screen buffers. The information about these buffers will then be passed to a display server process by using the Wayland protocol. Finally, the display server process will composite and position the contents on a physical display.

Qt Wayland Compositor is a module that provides convenient and powerful QML and C++ APIs for developing custom display servers based on this protocol. The server displays content from client applications that support the Wayland protocol. The design philosophy of Wayland is to keep the core protocol simple and minimal, and to expand on this with use-case-specific extensions. Qt Wayland Compositor supports many common extensions by default, and also has APIs that enables the creation of new, custom extensions.

In one typical use case, a display server written with Qt Wayland Compositor will be a subsystem inside a larger application manager process. Qt Wayland Compositor provides the APIs to communicate with clients and display their contents on screen, using C++ for low-level access and the full set of Qt Quick effects, animations and convenience when using the QML APIs. A typical application manager would, in addition to this, implement features such as application life cycle, virtual keyboard input, security and IPC. Qt provides APIs that can be used to develop the remaining parts of an application manager in other modules. The Qt Automotive Suite provides a complete application manager which includes a display server developed using Qt Wayland Compositor.

Qt Wayland Compositor 的特征

The Qt Wayland Compositor API includes features needed to create a display server.

  • A QML API that can be used to display and manipulate client content, fully integrated with all the features in Qt Quick.
  • A C++ API for low-level access and control.
  • Support for common extensions, including XDG Shell and IVI Application.
  • APIs to easily expand support to include custom extensions.

环境变量和命令行自变量

The Qt Wayland Compositor API recognizes some environment variables and command-line arguments that can be used to customize its behavior.

  • 环境变量:
    • QT_WAYLAND_HARDWARE_INTEGRATION Selects the hardware integration plugin to use.
    • QT_WAYLAND_CLIENT_BUFFER_INTEGRATION Selects the client buffer integration plugin to use.
    • QT_WAYLAND_SERVER_BUFFER_INTEGRATION Selects the server integration plugin to use.
  • 命令行自变量:
    • --wayland-socket-name Overrides the default socket name used for communicating with clients.

范例

查看 Qt Wayland Compositor 范例 for a demonstration on how the APIs can be used to write custom display servers.

许可和归属

Qt Wayland Compositor 和 Qt Wayland 集成插件在商业许可下是可用的来自 Qt 公司 。此外,它们是可用的在 GNU LGPL (次一般公共许可) 第 3 版 ,或 GNU GPL (一般公共许可) 第 2 版 。见 Qt 许可 进一步了解细节。

Qt Wayland Compositor 和 Qt Wayland 集成插件所用协议定义遵循以下准许许可:

Wayland EGLStream Controller Protocol MIT 许可
Wayland IVI Extension Protocol, version 1.9.1 MIT 许可
Wayland Protocol, version 1.6.1 HPND 许可
Wayland 文本输入协议 HPND 许可
Wayland XDG Output Protocol, version unstable v1, version 2 MIT 许可
Wayland XDG Shell Protocol, version 1.9.0 MIT 许可
Wayland xdg-decoration Protocol, version unstable v1, version 1 MIT 许可

API 参考

The Qt Wayland Compositor API can be used from C++ or QML.