Core Wayland window system code and protocol
Find a file
Kristian Høgsberg 853c24e699 client: Introduce functions to allocate and marshal proxies atomically
The server requires clients to only allocate one ID ahead of the previously
highest ID in order to keep the ID range tight.  Failure to do so will
make the server close the client connection.  However, the way we allocate
new IDs is racy.  The generated code looks like:

  new_proxy = wl_proxy_create(...);
  wl_proxy_marshal(proxy, ... new_proxy, ...);

If two threads do this at the same time, there's a chance that thread A
will allocate a proxy, then get pre-empted by thread B which then allocates
a proxy and then passes it to wl_proxy_marshal().  The ID for thread As
proxy will be one higher that the currently highest ID, but the ID for
thread Bs proxy will be two higher.  But since thread B prempted thread A
before it could send its new ID, B will send its new ID first, the server
will see the ID from thread Bs proxy first, and will reject it.

We fix this by introducing wl_proxy_marshal_constructor().  This
function is identical to wl_proxy_marshal(), except that it will
allocate a wl_proxy for NEW_ID arguments and send it, all under the
display mutex.  By introducing a new function, we maintain backwards
compatibility with older code from the generator, and make sure that
the new generated code has an explicit dependency on a new enough
libwayland-client.so.

A virtual Wayland merit badge goes to Kalle Vahlman, who tracked this
down and analyzed the issue.

Reported-by: Kalle Vahlman <kalle.vahlman@movial.com>
2013-11-15 20:49:36 -08:00
cursor wayland: Be consistent about #include-guard names 2013-10-21 14:39:06 -07:00
doc Add documentation for wl_shm_buffer_begin/end_access 2013-11-15 14:46:48 -08:00
m4 Clean up .gitignore files 2010-11-11 20:11:27 -05:00
protocol protocol: add sub-surfaces to the core 2013-11-15 20:49:36 -08:00
spec doc: move documentation from the tex file to docbook 2012-03-28 23:04:25 -04:00
src client: Introduce functions to allocate and marshal proxies atomically 2013-11-15 20:49:36 -08:00
tests tests: add wl_resource tests 2013-09-21 11:38:32 -07:00
.gitignore gitignore: add ./compile 2013-09-11 12:15:11 -07:00
autogen.sh Update autotools configuration 2010-11-06 21:04:03 -04:00
configure.ac protocol: validate the protocol against a dtd 2013-10-25 10:58:06 -07:00
COPYING Add COPYING 2012-04-25 10:12:21 -04:00
Makefile.am protocol: validate the protocol against a dtd 2013-10-25 10:58:06 -07:00
README README: Fix typos 2013-02-14 12:14:54 -05:00
TODO Update TODO 2012-10-21 20:53:37 -04:00
wayland-scanner.m4 scanner: check for wayland-scanner.pc before using variables 2013-08-07 16:25:10 -07:00
wayland-scanner.mk Split into a core repository that only holds the core Wayland libraries 2011-02-14 22:21:13 -05:00

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.