mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
Core Wayland window system code and protocol
The existing specification was not explicitly clear on when wl_subcompositor.get_subsurface request actually adds the sub-surface to the parent in the compositor's scenegraph. The implicit assumption was that this happens immediately, but it was not written anywhere. If it happens immediately, the client doing things in a wrong order may cause a glitch on screen. Particularly, if the wl_surface B that is going to be a sub-surface for wl_surface A (the parent) already has a buffer committed, and the parent surface is mapped, then get_subsurface will (may?) cause wl_surface B to become mapped immediately. That leaves no time to set up the sub-surface z-order or position before mapping, hence there can be a visible glitch. The way to avoid that, given that the parent surface is mapped, is to not commit a buffer to wl_surface B until all the sub-surface setup is done. However, doing the sub-surface setup always requires a wl_surface.commit on the parent surface unless the defaults happen to be correct. To make setting up a subsurface slightly easier by removing one possibility for a glitch, this patch amends the specification to require a wl_surface.commit on the parent surface for get_subsurface to complete. The sub-surface cannot become mapped before a parent commit. This change may break existing clients that relied on the glitchy sequence to not need a parent surface commit to map the sub-surface. However, presumably all uses would at least issue a wl_subsurface.set_position, which requires a parent surface commit to apply. That would guarantee that there is a parent surface commit after get_subsurface, and so reduces the chances of breaking anything. In other cases, this change may simply remove a possibility for the glitch. This patch also adds a note about changing wl_surface.commit behaviour on wl_subcompositor.get_subsurface. (That could be a separate patch.) The behaviour of wl_subsurface.destroy remains as specified, even though it is now slightly asymmetrical to get_subsurface. This is emphasized by adding the word "immediately". The effects of destruction were already explicitly documented, as is the way to achieve synchronized unmapping, so changing destruction behaviour would likely be more disruptive, and also open up more corner cases (what would happen between destroy and unmapping?). Bug: https://phabricator.freedesktop.org/T7358 Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Martin Gräßlin <mgraesslin@kde.org> |
||
|---|---|---|
| cursor | ||
| doc | ||
| m4 | ||
| protocol | ||
| spec | ||
| src | ||
| tests | ||
| .gitignore | ||
| autogen.sh | ||
| configure.ac | ||
| COPYING | ||
| Makefile.am | ||
| publish-doc | ||
| README | ||
| TODO | ||
| wayland-scanner.m4 | ||
| wayland-scanner.mk | ||
What is Wayland?
Wayland is a project to define a protocol for a compositor to talk to
its clients as well as a library implementation of the protocol. The
compositor can be a standalone display server running on Linux kernel
modesetting and evdev input devices, an X application, or a wayland
client itself. The clients can be traditional applications, X servers
(rootless or fullscreen) or other display servers.
The wayland protocol is essentially only about input handling and
buffer management. The compositor receives input events and forwards
them to the relevant client. The clients creates buffers and renders
into them and notifies the compositor when it needs to redraw. The
protocol also handles drag and drop, selections, window management and
other interactions that must go through the compositor. However, the
protocol does not handle rendering, which is one of the features that
makes wayland so simple. All clients are expected to handle rendering
themselves, typically through cairo or OpenGL.
The weston compositor is a reference implementation of a wayland
compositor and the weston repository also includes a few example
clients.
Building the wayland libraries is fairly simple, aside from libffi,
they don't have many dependencies:
$ git clone git://anongit.freedesktop.org/wayland/wayland
$ cd wayland
$ ./autogen.sh --prefix=PREFIX
$ make
$ make install
where PREFIX is where you want to install the libraries. See
http://wayland.freedesktop.org for more complete build instructions
for wayland, weston, xwayland and various toolkits.