diff -Nru wayland-0.94.90+git20120712.52e6dc71/ChangeLog wayland-0.95.0+git20120801.7f3d2277/ChangeLog --- wayland-0.94.90+git20120712.52e6dc71/ChangeLog 2012-07-12 17:06:10.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/ChangeLog 2012-08-01 06:22:25.000000000 +0000 @@ -1,9 +1,202 @@ -commit d28702635314d8c69305d0a67d548787efbba38a +commit 4a53580365ce6af5d27dfee1fd4a49368248818a Author: Rico Tzschichholz -Date: Thu Jul 12 19:05:54 2012 +0200 +Date: Wed Aug 1 08:22:04 2012 +0200 Add debian tree from origin/ubuntu +commit 7f3d22776bc74d7deae0966681ed176363ea1781 +Author: Andre Heider +Date: Tue Jul 31 18:59:09 2012 +0200 + + protocol: Remove "repeat" from "key_state" + + This is unused and apparently was never implemented. + +commit 31c0258ff145c4a6524d3dd369dbf4643a5dc4b7 +Author: Dima Ryazanov +Date: Thu Jul 26 01:39:48 2012 -0700 + + Don't skip the first directory entry when reading cursors. + + I end up missing the "bottom_right_corner" cursor. + +commit f5ccd7a9e670e097ff9b5faae8a26b3af4bb7b60 +Author: Kristian Høgsberg +Date: Tue Jul 24 15:45:00 2012 -0400 + + Bump version to 0.95.0 + +commit 6ebde80f0f5c614a3ef95003b788ee6a7694413f +Author: Kristian Høgsberg +Date: Tue Jul 24 15:10:12 2012 -0400 + + Make distcheck work from builddir configured with --disable-documentation + +commit 3ec40512c7e43c5e5a223a9d33e4737a0782916a +Author: Daniel Stone +Date: Mon Jul 23 19:54:42 2012 +0100 + + More consistent ID printing + + Use unsigned rather than signed for IDs, so they match up with what we + see in other prints. + + Signed-off-by: Daniel Stone + +commit db0add6d5e23deac53c834f73d5e56180600cead +Author: Daniel Stone +Date: Mon Jul 23 19:54:41 2012 +0100 + + Make NEW_IDs nullable + + The connection-handling code already allows this, so make it legal in + the protocol definition too. + + Signed-off-by: Daniel Stone + +commit efe23443d8bcdad0513d5dd9d027233b3d7dc968 +Author: Daniel Stone +Date: Mon Jul 23 19:54:40 2012 +0100 + + Unstatic arg_count_for_signature and get_next_argument + + Expose these to other files using wayland-private.h, so wayland-client.c + can walk NULLables properly. + + Signed-off-by: Daniel Stone + +commit a2c79b14a1aa58424eae77db39ded4d745acce1d +Author: Kristian Høgsberg +Date: Mon Jul 23 20:14:33 2012 -0400 + + tests: Wrap calloc by just returning NULL if we're called too early + + Since glibc dlsym() calls calloc, we get a call to our calloc wrapper as + we try to look up the real calloc implementation. dlsym() will fall back + to a static buffer in case calloc returns NULL, so that's what we'll do. + + This is all highly glibc dependent, of course, but the entire malloc + weak symbol wrapper mechanism is, so there's no loss of generality here. + +commit 61e9196f565e02b1774699e865a81a4efd3904bb +Author: Daniel Stone +Date: Mon Jul 23 19:54:39 2012 +0100 + + test-runner: Wrap realloc() too + + So all our tests don't start failing just because we had the temerity to + use realloc() rather than malloc(). + + Signed-off-by: Daniel Stone + +commit 16b4c8747053e73bb963ea2bdf566cc54b9aeb90 +Author: Daniel Stone +Date: Mon Jul 23 19:54:38 2012 +0100 + + .gitignore: Add ctags and cscope files + + Signed-off-by: Daniel Stone + +commit eadb68ec32df8ee54ccba175d19adcdedfaa5015 +Author: Kristian Høgsberg +Date: Sun Jul 22 15:46:16 2012 -0400 + + protocol: Add transform argument to wl_output.geometry event + +commit 0b8b397e3438f0acad78ce2646bacc4905c97f01 +Author: Mathias Fiedler +Date: Wed Jul 18 15:53:23 2012 +0200 + + connection: reserve id on incoming new object + + If a new object id arrives ensure that there is an empty array entry + created, otherwise we might get out of sync for new ids if object isn't + created by interface implementation. + +commit bfcd6819303b0304ba38d57af4856eb6db286907 +Author: Mathias Fiedler +Date: Wed Jul 18 15:52:51 2012 +0200 + + wayland-util: add method for reserving new object id + + wl_map_reserve_new() ensures that new id is valid and will point to an + empty array entry. + +commit 900e4b63ef185767a4f1f1eea0ea1fb9899b4da5 +Author: Mathias Fiedler +Date: Wed Jul 18 15:51:45 2012 +0200 + + wayland-server: send error on invalid new object id + + Creation of new client resources was silently ignored when + wl_client_add_resource() was used on server side and new object id was out + of range. + + An error is now send out to the client in such case. + + Also changed error message in wl_client_add_object, since + wl_map_insert_at() returns -1 only at invalid new id. + +commit 76bfd68f47c6cd8552151aa90efc4e5d074d14f9 +Author: Kristian Høgsberg +Date: Fri Jul 20 12:30:07 2012 -0400 + + wayland-shm: Commit the width/height getters that actually compile + +commit 0b4ed5fe72bb96b0b0ef6bfdb280889b51da62dc +Author: Kristian Høgsberg +Date: Fri Jul 20 12:20:15 2012 -0400 + + README: Update + + The wayland README had outdated build instructions for weston. Let's just + trim it down to build instructions for wayland and a link to the web site. + +commit 7ba218c9f80c9ce6f1a54e4e1b2f8aa66c590ade +Author: Kristian Høgsberg +Date: Fri Jul 20 12:04:42 2012 -0400 + + shm: Add shm_buffer getters for width and height + +commit 0a9cd16f6a6819392777e7b50601bb7e39b019da +Author: Robert Ancell +Date: Tue Jul 10 15:52:12 2012 +1200 + + wayland-client: Add missing newline from an error message + +commit 2e79c4877fc4f402297e9d685b5eb2c41d7dd814 +Author: Dmitry Guryanov +Date: Tue Jul 17 18:56:03 2012 +0400 + + remove listener from wl_data_source destroy_signal listener list + + I've found a bug during wayland exploration - if you make two + drag'n'drops in weston client example, dnd - weston crashes with + segfault. I've tried to investigate it and found a problem. + + In function drag_grab_button we first call data_device_end_drag_grab, + which sets seat->drag_data_source to NULL. Then we remove + listener from list only if drag_data_source is not NULL. + + So if client will not free wl_data_source and start another drag'n'drop, + after the first one. Then two wl_data_source structures will be + free'd on client exit (let's name them s1 and s2). + + next and prev pointer of + wl_data_source.resource.destroy_signal.listener_list in both + wl_data_source structures will be seat->drag_data_source_listener, + but next and prev in seat->drag_data_source_listener.link point + to listener_list in s2. + + So if you try to iterate over listener_list in s1 + then you get drag_data_source_listener as first item and + (struct wl_listener *)(&s2.resource.destroy_signal.listener_list) + + Iteration over that list occurs in + wl_resource_destroy->destroy_resource->wl_signal_emit->wl_signal_emit + and try to call function at address of wl_resource->client, so + weston segfaults there. + commit 52e6dc71becf4ee7f473f8af79fd71f95b6889c0 Author: Pekka Paalanen Date: Tue Jul 10 13:05:03 2012 +0300 diff -Nru wayland-0.94.90+git20120712.52e6dc71/configure wayland-0.95.0+git20120801.7f3d2277/configure --- wayland-0.94.90+git20120712.52e6dc71/configure 2012-07-12 17:06:09.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/configure 2012-08-01 06:22:22.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for wayland 0.94.90. +# Generated by GNU Autoconf 2.69 for wayland 0.95.0. # # Report bugs to . # @@ -591,8 +591,8 @@ # Identity of this package. PACKAGE_NAME='wayland' PACKAGE_TARNAME='wayland' -PACKAGE_VERSION='0.94.90' -PACKAGE_STRING='wayland 0.94.90' +PACKAGE_VERSION='0.95.0' +PACKAGE_STRING='wayland 0.95.0' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=wayland' PACKAGE_URL='http://wayland.freedesktop.org/' @@ -1339,7 +1339,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures wayland 0.94.90 to adapt to many kinds of systems. +\`configure' configures wayland 0.95.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1409,7 +1409,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of wayland 0.94.90:";; + short | recursive ) echo "Configuration of wayland 0.95.0:";; esac cat <<\_ACEOF @@ -1524,7 +1524,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -wayland configure 0.94.90 +wayland configure 0.95.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1893,7 +1893,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by wayland $as_me 0.94.90, which was +It was created by wayland $as_me 0.95.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2244,11 +2244,11 @@ WAYLAND_VERSION_MAJOR=0 -WAYLAND_VERSION_MINOR=94 +WAYLAND_VERSION_MINOR=95 -WAYLAND_VERSION_MICRO=90 +WAYLAND_VERSION_MICRO=0 -WAYLAND_VERSION=0.94.90 +WAYLAND_VERSION=0.95.0 ac_config_headers="$ac_config_headers config.h" @@ -2722,7 +2722,7 @@ # Define the identity of the package. PACKAGE='wayland' - VERSION='0.94.90' + VERSION='0.95.0' cat >>confdefs.h <<_ACEOF @@ -12357,7 +12357,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by wayland $as_me 0.94.90, which was +This file was extended by wayland $as_me 0.95.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -12424,7 +12424,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -wayland config.status 0.94.90 +wayland config.status 0.95.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru wayland-0.94.90+git20120712.52e6dc71/configure.ac wayland-0.95.0+git20120801.7f3d2277/configure.ac --- wayland-0.94.90+git20120712.52e6dc71/configure.ac 2012-07-12 17:05:54.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/configure.ac 2012-08-01 06:22:03.000000000 +0000 @@ -1,8 +1,8 @@ AC_PREREQ([2.64]) m4_define([wayland_major_version], [0]) -m4_define([wayland_minor_version], [94]) -m4_define([wayland_micro_version], [90]) +m4_define([wayland_minor_version], [95]) +m4_define([wayland_micro_version], [0]) m4_define([wayland_version], [wayland_major_version.wayland_minor_version.wayland_micro_version]) diff -Nru wayland-0.94.90+git20120712.52e6dc71/cursor/xcursor.c wayland-0.95.0+git20120801.7f3d2277/cursor/xcursor.c --- wayland-0.94.90+git20120712.52e6dc71/cursor/xcursor.c 2012-07-12 17:05:54.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/cursor/xcursor.c 2012-08-01 06:22:03.000000000 +0000 @@ -870,7 +870,6 @@ if (!dir) return; - ent = readdir(dir); for(ent = readdir(dir); ent; ent = readdir(dir)) { #ifdef _DIRENT_HAVE_D_TYPE if (ent->d_type != DT_UNKNOWN && diff -Nru wayland-0.94.90+git20120712.52e6dc71/debian/changelog wayland-0.95.0+git20120801.7f3d2277/debian/changelog --- wayland-0.94.90+git20120712.52e6dc71/debian/changelog 2012-08-01 06:37:11.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/debian/changelog 2012-08-01 06:37:13.000000000 +0000 @@ -1,11 +1,11 @@ -wayland (0.94.90+git20120712.52e6dc71-0ubuntu0ricotz~precise) precise; urgency=medium +wayland (0.95.0+git20120801.7f3d2277-0ubuntu0ricotz~precise) precise; urgency=medium - * Checkout from git 20120712 (master branch) up to commit - 52e6dc71becf4ee7f473f8af79fd71f95b6889c0 + * Checkout from git 20120801 (master branch) up to commit + 7f3d22776bc74d7deae0966681ed176363ea1781 * Only added debian/ tree from origin/ubuntu * hook: Ignore test failures. - -- Rico Tzschichholz Thu, 12 Jul 2012 19:06:11 +0200 + -- Rico Tzschichholz Wed, 01 Aug 2012 08:22:27 +0200 wayland (0.85.0-1ubuntu2) precise; urgency=low diff -Nru wayland-0.94.90+git20120712.52e6dc71/doc/Wayland/Makefile.am wayland-0.95.0+git20120801.7f3d2277/doc/Wayland/Makefile.am --- wayland-0.94.90+git20120712.52e6dc71/doc/Wayland/Makefile.am 2012-07-12 17:05:54.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/doc/Wayland/Makefile.am 2012-08-01 06:22:03.000000000 +0000 @@ -1,7 +1,3 @@ -if HAVE_PUBLICAN -noinst_DATA = Wayland $(publican_targets) -pubdir = $(docdir)/Wayland/en-US - publican_sources = \ $(srcdir)/en_US/Wayland.ent \ $(srcdir)/en_US/Architecture.xml \ @@ -16,6 +12,10 @@ $(srcdir)/en_US/images/wayland.png \ $(srcdir)/en_US/images/x-architecture.png +if HAVE_PUBLICAN +noinst_DATA = Wayland $(publican_targets) +pubdir = $(docdir)/Wayland/en-US + publican_targets = $(publican_sources:$(srcdir)/en_US%=$(builddir)/en-US%) \ en-US/ProtocolSpec.xml @@ -66,6 +66,6 @@ fi; \ fi; -EXTRA_DIST = $(publican_sources) publican.cfg protocol-to-docbook.xsl - endif + +EXTRA_DIST = $(publican_sources) publican.cfg protocol-to-docbook.xsl diff -Nru wayland-0.94.90+git20120712.52e6dc71/doc/Wayland/Makefile.in wayland-0.95.0+git20120801.7f3d2277/doc/Wayland/Makefile.in --- wayland-0.94.90+git20120712.52e6dc71/doc/Wayland/Makefile.in 2012-07-12 17:06:10.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/doc/Wayland/Makefile.in 2012-08-01 06:22:23.000000000 +0000 @@ -207,27 +207,27 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +publican_sources = \ + $(srcdir)/en_US/Wayland.ent \ + $(srcdir)/en_US/Architecture.xml \ + $(srcdir)/en_US/Author_Group.xml \ + $(srcdir)/en_US/Book_Info.xml \ + $(srcdir)/en_US/Wayland.xml \ + $(srcdir)/en_US/Protocol.xml \ + $(srcdir)/en_US/Compositors.xml \ + $(srcdir)/en_US/Overview.xml \ + $(srcdir)/en_US/images/icon.svg \ + $(srcdir)/en_US/images/wayland-architecture.png \ + $(srcdir)/en_US/images/wayland.png \ + $(srcdir)/en_US/images/x-architecture.png + @HAVE_PUBLICAN_TRUE@noinst_DATA = Wayland $(publican_targets) @HAVE_PUBLICAN_TRUE@pubdir = $(docdir)/Wayland/en-US -@HAVE_PUBLICAN_TRUE@publican_sources = \ -@HAVE_PUBLICAN_TRUE@ $(srcdir)/en_US/Wayland.ent \ -@HAVE_PUBLICAN_TRUE@ $(srcdir)/en_US/Architecture.xml \ -@HAVE_PUBLICAN_TRUE@ $(srcdir)/en_US/Author_Group.xml \ -@HAVE_PUBLICAN_TRUE@ $(srcdir)/en_US/Book_Info.xml \ -@HAVE_PUBLICAN_TRUE@ $(srcdir)/en_US/Wayland.xml \ -@HAVE_PUBLICAN_TRUE@ $(srcdir)/en_US/Protocol.xml \ -@HAVE_PUBLICAN_TRUE@ $(srcdir)/en_US/Compositors.xml \ -@HAVE_PUBLICAN_TRUE@ $(srcdir)/en_US/Overview.xml \ -@HAVE_PUBLICAN_TRUE@ $(srcdir)/en_US/images/icon.svg \ -@HAVE_PUBLICAN_TRUE@ $(srcdir)/en_US/images/wayland-architecture.png \ -@HAVE_PUBLICAN_TRUE@ $(srcdir)/en_US/images/wayland.png \ -@HAVE_PUBLICAN_TRUE@ $(srcdir)/en_US/images/x-architecture.png - @HAVE_PUBLICAN_TRUE@publican_targets = $(publican_sources:$(srcdir)/en_US%=$(builddir)/en-US%) \ @HAVE_PUBLICAN_TRUE@ en-US/ProtocolSpec.xml @HAVE_PUBLICAN_TRUE@CLEANFILES = en-US/ProtocolSpec.xml $(publican_targets) -@HAVE_PUBLICAN_TRUE@EXTRA_DIST = $(publican_sources) publican.cfg protocol-to-docbook.xsl +EXTRA_DIST = $(publican_sources) publican.cfg protocol-to-docbook.xsl all: all-am .SUFFIXES: diff -Nru wayland-0.94.90+git20120712.52e6dc71/.gitignore wayland-0.95.0+git20120801.7f3d2277/.gitignore --- wayland-0.94.90+git20120712.52e6dc71/.gitignore 2011-11-15 21:42:49.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/.gitignore 2012-08-01 06:22:03.000000000 +0000 @@ -8,6 +8,8 @@ *.swp *~ .libs +cscope.out +ctags /aclocal.m4 /wayland-scanner.m4 /autom4te.cache diff -Nru wayland-0.94.90+git20120712.52e6dc71/.lastcommit wayland-0.95.0+git20120801.7f3d2277/.lastcommit --- wayland-0.94.90+git20120712.52e6dc71/.lastcommit 2012-07-12 17:05:54.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/.lastcommit 2012-08-01 06:22:04.000000000 +0000 @@ -1 +1 @@ -commit 52e6dc71becf4ee7f473f8af79fd71f95b6889c0 +commit 7f3d22776bc74d7deae0966681ed176363ea1781 diff -Nru wayland-0.94.90+git20120712.52e6dc71/protocol/wayland.xml wayland-0.95.0+git20120801.7f3d2277/protocol/wayland.xml --- wayland-0.94.90+git20120712.52e6dc71/protocol/wayland.xml 2012-07-12 17:05:54.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/protocol/wayland.xml 2012-08-01 06:22:03.000000000 +0000 @@ -908,11 +908,9 @@ Describes the physical state of a key which provoked the key event. - When a key repeats, the sequence is down -> repeat -> repeat -> up. - @@ -1001,6 +999,31 @@ + + + This describes the transform that a compositor will apply to a + surface to compensate for the rotation or mirroring of an + output device. + + The flipped values correspond to an initial flip around a + vertical axis followed by rotaion. + + The purpose is mainly to allow clients render accordingly and + tell the compositor, so that for fullscreen surfaces, the + compositor will still be able to scan out directly from client + surfaces. + + + + + + + + + + + + + diff -Nru wayland-0.94.90+git20120712.52e6dc71/README wayland-0.95.0+git20120801.7f3d2277/README --- wayland-0.94.90+git20120712.52e6dc71/README 2012-07-12 17:05:54.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/README 2012-08-01 06:22:03.000000000 +0000 @@ -17,114 +17,19 @@ makes wayland so simple. All clients are expected to handle rendering themselves, typically through cairo or OpenGL. -The wayland repository includes a compositor and a few clients, but -both the compositor and clients are essentially test cases. - - -Building Instructions - -The instructions below assume some familiarity with git and building -and running experimental software. And be prepared that this project -isn't at all useful right now, it's still very much a prototype. When -the instructions suggest to clone a git repo, you can of course just -add a remote and fetch instead, if you have a clone of that repo -around already. I usually install all software I'm working on into -$HOME/install, so that's what I'll use in the instructions below, but -you can use your favorite directory of course or install over your -system copy (pass --prefix=/usr --sysconfdir=/etc, generally). - - -Modesetting - -At this point, kernel modesetting is upstream for Intel, AMD and -nVidia chipsets. Most distributions ship with kernel modesetting -enabled by default and will work with Wayland out of the box. The -modesetting driver must also support the page flip ioctl, which only -the intel driver does at this point. - - -Building mesa - -Wayland uses the mesa EGL stack, and all extensions required to run -EGL on KMS are now upstream on the master branch. The 7.9 release of -mesa will have all these extensions, but for now you'll need to build -mesa master: - - $ git clone git://anongit.freedesktop.org/mesa/mesa - $ cd mesa - $ ./configure --prefix=$HOME/install --enable-egl --enable-gles2 - $ make && make install - -If you're using an intel chipset, it's best to also pass ---disable-gallium to ./configure, since otherwise libEGL will try to -load the gallium sw rasterizer before loading the Intel DRI driver. - - -libxkbcommon - -Wayland needs libxkbcommon for translating evdev keycodes to keysyms. -There's a couple of repos around, and we're trying to consolidate the -development, but for wayland you'll need the repo from my git -repository. For this you'll need development packages for xproto, -kbproto and libX11. - - $ git clone git://people.freedesktop.org/~krh/libxkbcommon.git - $ cd libxkbcommon/ - $ ./autogen.sh --prefix=$HOME/install - $ make && make install - - -cairo-gl - -The Wayland clients render using cairo-gl, which is an experimental -cairo backend. It has been available since cairo 1.10. Unless your -distribution ships cairo with the gl backend enabled, you'll need to -compile your own version of cairo: - - $ git clone git://anongit.freedesktop.org/cairo - $ cd cairo - $ ./autogen.sh --prefix=$HOME/install --enable-gl - $ make && make install - - -Wayland - -With mesa and libxkbcommon in place, we can checkout and build -Wayland. Aside from mesa, Wayland needs development packages for -gdk-pixbuf-2.0, libudev, libdrm, xcb-dri2, xcb-fixes (for X -compositor) cairo-gl, glib-2.0, gdk-2.0 (for poppler) and -poppler-glib: - - $ git clone git://people.freedesktop.org/~krh/wayland - $ ./autogen.sh --prefix=$HOME/install - $ make && make install - -Installing into a non-/usr prefix is fine, but the 70-wayland.rules -udev rule file has to be installed in /etc/udev/rules.d. Once -installed, either reboot or run - - $ sudo udevadm trigger --subsystem-match=drm --subsystem-match=input - -to make udev label the devices wayland will use. - -If DISPLAY is set, the wayland compositor will run under X in a window -and take input from X. Otherwise it will run on the KMS framebuffer -and take input from evdev devices. Pick a background image that you -like and copy it to the Wayland source directory as background.jpg or -use the -b command line option: - - $ ./wayland-system-compositor -b my-image.jpg - -To run clients, switch to a different VT and run the client from -there. Or run it under X and start up the clients from a terminal -window. There are a few demo clients available, but they are all -pretty simple and mostly for testing specific features in the wayland -protocol: 'terminal' is a simple terminal emulator, not very compliant -at all, but works well enough for bash - - 'flower' moves a flower around the screen, testing the frame protocol - 'gears' glxgears, but for wayland, currently broken - 'image' loads the image files passed on the command line and shows them - - 'view' does the same for pdf files, but needs file URIs - (file:///path/to/pdf) +The weston compositor is a reference implementation of a wayland +compositor and the weston repository also includes a few example +clients 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. \ No newline at end of file diff -Nru wayland-0.94.90+git20120712.52e6dc71/src/connection.c wayland-0.95.0+git20120801.7f3d2277/src/connection.c --- wayland-0.94.90+git20120712.52e6dc71/src/connection.c 2012-07-12 17:05:54.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/src/connection.c 2012-08-01 06:22:03.000000000 +0000 @@ -404,12 +404,7 @@ return 0; } -struct argument_details { - char type; - int nullable; -}; - -static const char * +const char * get_next_argument(const char *signature, struct argument_details *details) { if (*signature == '?') { @@ -422,7 +417,7 @@ return signature + 1; } -static int +int arg_count_for_signature(const char *signature) { int count = 0; @@ -537,6 +532,10 @@ object = va_arg(ap, struct wl_object *); if (end - p < 1) goto err; + + if (!arg.nullable && object == NULL) + goto err_null; + *p++ = object ? object->id : 0; break; @@ -724,13 +723,22 @@ extra += sizeof *object; closure->args[i] = object; + if (*p == 0 && !arg.nullable) { + printf("NULL new ID received on non-nullable " + "type, message %s(%s)\n", message->name, + message->signature); + *object = NULL; + errno = EINVAL; + goto err; + } + *object = wl_map_lookup(objects, *p); if (*object == WL_ZOMBIE_OBJECT) { /* references object we've already * destroyed client side */ *object = NULL; } else if (*object == NULL && *p != 0) { - printf("unknown object (%d), message %s(%s)\n", + printf("unknown object (%u), message %s(%s)\n", *p, message->name, message->signature); *object = NULL; errno = EINVAL; @@ -739,7 +747,7 @@ if (*object != NULL && message->types[i-2] != NULL && (*object)->interface != message->types[i-2]) { - printf("invalid object (%d), type (%s), " + printf("invalid object (%u), type (%s), " "message %s(%s)\n", *p, (*object)->interface->name, message->name, message->signature); @@ -756,14 +764,22 @@ closure->args[i] = id; *id = p; - object = wl_map_lookup(objects, *p); - if (object != NULL) { - printf("not a new object (%d), " + if (*id == 0 && !arg.nullable) { + printf("NULL new ID received on non-nullable " + "type, message %s(%s)\n", message->name, + message->signature); + errno = EINVAL; + goto err; + } + + if (wl_map_reserve_new(objects, *p) < 0) { + printf("not a valid new object id (%d), " "message %s(%s)\n", *p, message->name, message->signature); errno = EINVAL; goto err; } + p++; break; case 'a': @@ -940,7 +956,17 @@ fprintf(stderr, "nil"); break; case 'n': - fprintf(stderr, "new id %u", value->uint32); + fprintf(stderr, "new id %s@", + (closure->message->types[i - 2]) ? + closure->message->types[i - 2]->name : + "[unknown]"); + if (send && value->new_id != 0) + fprintf(stderr, "%u", value->new_id); + else if (!send && value->object != NULL) + fprintf(stderr, "%u", + *((uint32_t *)value->object)); + else + fprintf(stderr, "nil"); break; case 'a': fprintf(stderr, "array"); diff -Nru wayland-0.94.90+git20120712.52e6dc71/src/data-device.c wayland-0.95.0+git20120801.7f3d2277/src/data-device.c --- wayland-0.94.90+git20120712.52e6dc71/src/data-device.c 2012-07-12 17:05:54.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/src/data-device.c 2012-08-01 06:22:03.000000000 +0000 @@ -265,9 +265,9 @@ if (seat->pointer->button_count == 0 && state == WL_POINTER_BUTTON_STATE_RELEASED) { - data_device_end_drag_grab(seat); if (seat->drag_data_source) wl_list_remove(&seat->drag_data_source_listener.link); + data_device_end_drag_grab(seat); } } diff -Nru wayland-0.94.90+git20120712.52e6dc71/src/scanner.c wayland-0.95.0+git20120801.7f3d2277/src/scanner.c --- wayland-0.94.90+git20120712.52e6dc71/src/scanner.c 2012-07-12 17:05:54.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/src/scanner.c 2012-08-01 06:22:03.000000000 +0000 @@ -228,6 +228,7 @@ /* Strings, objects, and arrays are possibly nullable */ case STRING: case OBJECT: + case NEW_ID: case ARRAY: return 1; default: diff -Nru wayland-0.94.90+git20120712.52e6dc71/src/wayland-client.c wayland-0.95.0+git20120801.7f3d2277/src/wayland-client.c --- wayland-0.94.90+git20120712.52e6dc71/src/wayland-client.c 2012-07-12 17:05:54.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/src/wayland-client.c 2012-08-01 06:22:03.000000000 +0000 @@ -203,14 +203,14 @@ abort(); } + if (wl_debug) + wl_closure_print(closure, &proxy->object, true); + if (wl_closure_send(closure, proxy->display->connection)) { fprintf(stderr, "Error sending request: %m\n"); abort(); } - if (wl_debug) - wl_closure_print(closure, &proxy->object, true); - wl_closure_destroy(closure); } @@ -235,7 +235,7 @@ struct wl_display *display, struct wl_object *object, uint32_t code, const char *message) { - fprintf(stderr, "%s@%d: error %d: %s\n", + fprintf(stderr, "%s@%u: error %d: %s\n", object->interface->name, object->id, code, message); abort(); } @@ -479,19 +479,29 @@ { struct wl_proxy *proxy; const char *signature; + struct argument_details arg; uint32_t id; int i; + int count; signature = closure->message->signature; - for (i = 0; signature[i]; i++) { - switch (signature[i]) { + count = arg_count_for_signature(signature) + 2; + for (i = 2; i < count; i++) { + signature = get_next_argument(signature, &arg); + switch (arg.type) { case 'n': - id = **(uint32_t **) closure->args[i + 2]; + id = **(uint32_t **) closure->args[i]; + if (id == 0) { + *(void **) closure->args[i] = NULL; + break; + } proxy = wl_proxy_create_for_id(&display->proxy, id, - closure->message->types[i]); + closure->message->types[i - 2]); if (proxy == NULL) return -1; - *(void **) closure->args[i + 2] = proxy; + *(void **) closure->args[i] = proxy; + break; + default: break; } } @@ -521,14 +531,14 @@ closure = wl_connection_demarshal(display->connection, size, &display->objects, message); + if (wl_debug) + wl_closure_print(closure, &proxy->object, false); + if (closure == NULL || create_proxies(display, closure) < 0) { fprintf(stderr, "Error demarshalling event\n"); abort(); } - if (wl_debug) - wl_closure_print(closure, &proxy->object, false); - wl_closure_invoke(closure, &proxy->object, proxy->object.implementation[opcode], proxy->user_data); @@ -545,7 +555,7 @@ mask &= display->mask; if (mask == 0) { fprintf(stderr, - "wl_display_iterate called with unsolicited flags"); + "wl_display_iterate called with unsolicited flags\n"); return; } diff -Nru wayland-0.94.90+git20120712.52e6dc71/src/wayland-private.h wayland-0.95.0+git20120801.7f3d2277/src/wayland-private.h --- wayland-0.94.90+git20120712.52e6dc71/src/wayland-private.h 2012-07-12 17:05:54.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/src/wayland-private.h 2012-08-01 06:22:03.000000000 +0000 @@ -46,6 +46,7 @@ void wl_map_release(struct wl_map *map); uint32_t wl_map_insert_new(struct wl_map *map, uint32_t side, void *data); int wl_map_insert_at(struct wl_map *map, uint32_t i, void *data); +int wl_map_reserve_new(struct wl_map *map, uint32_t i); void wl_map_remove(struct wl_map *map, uint32_t i); void *wl_map_lookup(struct wl_map *map, uint32_t i); void wl_map_for_each(struct wl_map *map, wl_iterator_func_t func, void *data); @@ -80,6 +81,17 @@ uint32_t buffer[0]; }; +struct argument_details { + char type; + int nullable; +}; + +const char * +get_next_argument(const char *signature, struct argument_details *details); + +int +arg_count_for_signature(const char *signature); + struct wl_closure * wl_closure_vmarshal(struct wl_object *sender, uint32_t opcode, va_list ap, diff -Nru wayland-0.94.90+git20120712.52e6dc71/src/wayland-server.c wayland-0.95.0+git20120801.7f3d2277/src/wayland-server.c --- wayland-0.94.90+git20120712.52e6dc71/src/wayland-server.c 2012-07-12 17:05:54.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/src/wayland-server.c 2012-08-01 06:22:03.000000000 +0000 @@ -243,7 +243,7 @@ if (resource == NULL) { wl_resource_post_error(client->display_resource, WL_DISPLAY_ERROR_INVALID_OBJECT, - "invalid object %d", p[0]); + "invalid object %u", p[0]); break; } @@ -251,7 +251,7 @@ if (opcode >= object->interface->method_count) { wl_resource_post_error(client->display_resource, WL_DISPLAY_ERROR_INVALID_METHOD, - "invalid method %d, object %s@%d", + "invalid method %d, object %s@%u", opcode, object->interface->name, object->id); @@ -263,10 +263,13 @@ &client->objects, message); len -= size; + if (wl_debug) + wl_closure_print(closure, object, false); + if (closure == NULL && errno == EINVAL) { wl_resource_post_error(client->display_resource, WL_DISPLAY_ERROR_INVALID_METHOD, - "invalid arguments for %s@%d.%s", + "invalid arguments for %s@%u.%s", object->interface->name, object->id, message->name); @@ -278,9 +281,6 @@ deref_new_objects(closure); - if (wl_debug) - wl_closure_print(closure, object, false); - wl_closure_invoke(closure, object, object->implementation[opcode], client); @@ -395,9 +395,12 @@ resource->object.id = wl_map_insert_new(&client->objects, WL_MAP_SERVER_SIDE, resource); - else - wl_map_insert_at(&client->objects, - resource->object.id, resource); + else if (wl_map_insert_at(&client->objects, + resource->object.id, resource) < 0) + wl_resource_post_error(client->display_resource, + WL_DISPLAY_ERROR_INVALID_OBJECT, + "invalid new id %d", + resource->object.id); resource->client = client; wl_signal_init(&resource->destroy_signal); @@ -1277,7 +1280,10 @@ wl_signal_init(&resource->destroy_signal); if (wl_map_insert_at(&client->objects, resource->object.id, resource) < 0) { - wl_resource_post_no_memory(client->display_resource); + wl_resource_post_error(client->display_resource, + WL_DISPLAY_ERROR_INVALID_OBJECT, + "invalid new id %d", + resource->object.id); free(resource); return NULL; } diff -Nru wayland-0.94.90+git20120712.52e6dc71/src/wayland-server.h wayland-0.95.0+git20120801.7f3d2277/src/wayland-server.h --- wayland-0.94.90+git20120712.52e6dc71/src/wayland-server.h 2012-07-12 17:05:54.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/src/wayland-server.h 2012-08-01 06:22:03.000000000 +0000 @@ -428,6 +428,12 @@ uint32_t wl_shm_buffer_get_format(struct wl_buffer *buffer); +int32_t +wl_shm_buffer_get_width(struct wl_buffer *buffer); + +int32_t +wl_shm_buffer_get_height(struct wl_buffer *buffer); + int wl_buffer_is_shm(struct wl_buffer *buffer); diff -Nru wayland-0.94.90+git20120712.52e6dc71/src/wayland-shm.c wayland-0.95.0+git20120801.7f3d2277/src/wayland-shm.c --- wayland-0.94.90+git20120712.52e6dc71/src/wayland-shm.c 2012-07-12 17:05:54.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/src/wayland-shm.c 2012-08-01 06:22:03.000000000 +0000 @@ -291,3 +291,19 @@ return buffer->format; } + +WL_EXPORT int32_t +wl_shm_buffer_get_width(struct wl_buffer *buffer_base) +{ + struct wl_shm_buffer *buffer = (struct wl_shm_buffer *) buffer_base; + + return buffer->buffer.width; +} + +WL_EXPORT int32_t +wl_shm_buffer_get_height(struct wl_buffer *buffer_base) +{ + struct wl_shm_buffer *buffer = (struct wl_shm_buffer *) buffer_base; + + return buffer->buffer.height; +} diff -Nru wayland-0.94.90+git20120712.52e6dc71/src/wayland-util.c wayland-0.95.0+git20120801.7f3d2277/src/wayland-util.c --- wayland-0.94.90+git20120712.52e6dc71/src/wayland-util.c 2012-07-12 17:05:54.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/src/wayland-util.c 2012-08-01 06:22:03.000000000 +0000 @@ -214,6 +214,39 @@ return 0; } +WL_EXPORT int +wl_map_reserve_new(struct wl_map *map, uint32_t i) +{ + union map_entry *start; + uint32_t count; + struct wl_array *entries; + + if (i < WL_SERVER_ID_START) { + entries = &map->client_entries; + } else { + entries = &map->server_entries; + i -= WL_SERVER_ID_START; + } + + count = entries->size / sizeof *start; + + if (count < i) + return -1; + + if (count == i) { + wl_array_add(entries, sizeof *start); + start = entries->data; + start[i].data = NULL; + } else { + start = entries->data; + if (start[i].data != NULL) { + return -1; + } + } + + return 0; +} + WL_EXPORT void wl_map_remove(struct wl_map *map, uint32_t i) { diff -Nru wayland-0.94.90+git20120712.52e6dc71/tests/connection-test.c wayland-0.95.0+git20120801.7f3d2277/tests/connection-test.c --- wayland-0.94.90+git20120712.52e6dc71/tests/connection-test.c 2012-07-12 17:05:54.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/tests/connection-test.c 2012-08-01 06:22:03.000000000 +0000 @@ -236,7 +236,7 @@ marshal(&data, "n", 12, &object); assert(data.buffer[2] == object.id); - marshal(&data, "n", 12, NULL); + marshal(&data, "?n", 12, NULL); assert(data.buffer[2] == 0); array.data = (void *) text; diff -Nru wayland-0.94.90+git20120712.52e6dc71/tests/test-runner.c wayland-0.95.0+git20120801.7f3d2277/tests/test-runner.c --- wayland-0.94.90+git20120712.52e6dc71/tests/test-runner.c 2012-07-12 17:05:54.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/tests/test-runner.c 2012-08-01 06:22:03.000000000 +0000 @@ -36,6 +36,8 @@ static int num_alloc; static void* (*sys_malloc)(size_t); static void (*sys_free)(void*); +static void* (*sys_realloc)(void*, size_t); +static void* (*sys_calloc)(size_t, size_t); extern const struct test __start_test_section, __stop_test_section; @@ -54,6 +56,25 @@ sys_free(mem); } +__attribute__ ((visibility("default"))) void * +realloc(void* mem, size_t size) +{ + if (mem == NULL) + num_alloc++; + return sys_realloc(mem, size); +} + +__attribute__ ((visibility("default"))) void * +calloc(size_t nmemb, size_t size) +{ + if (sys_calloc == NULL) + return NULL; + + num_alloc++; + + return sys_calloc(nmemb, size); +} + static const struct test * find_test(const char *name) { @@ -86,7 +107,9 @@ int total, pass; siginfo_t info; - /* Load system malloc and free */ + /* Load system malloc, free, and realloc */ + sys_calloc = dlsym(RTLD_NEXT, "calloc"); + sys_realloc = dlsym(RTLD_NEXT, "realloc"); sys_malloc = dlsym(RTLD_NEXT, "malloc"); sys_free = dlsym(RTLD_NEXT, "free"); diff -Nru wayland-0.94.90+git20120712.52e6dc71/TODO wayland-0.95.0+git20120801.7f3d2277/TODO --- wayland-0.94.90+git20120712.52e6dc71/TODO 2012-07-12 17:05:54.000000000 +0000 +++ wayland-0.95.0+git20120801.7f3d2277/TODO 2012-08-01 06:22:03.000000000 +0000 @@ -1,12 +1,5 @@ Core wayland protocol - - We need rotation information in the output (multiples of 90 - degrees) and we'll need a way for a client to communicate that it - has rendered its buffer according to the output rotation. The - goal is to be able to pageflip directly to the client buffer, and - for that we need the client to render accordingly and the - compositor needs to know that it did. - - Atomicity. Currently a lot of the atomicity in Wayland relies on how we batch up all requests in a protocol buffer and only flushes in the "blockhandler" in the client. Consensus was that we need