platform/upstream/wayland.git
9 years agocursor: free the array from which images are linked
Emmanuel Gil Peyrot [Wed, 18 Mar 2015 00:53:22 +0000 (01:53 +0100)]
cursor: free the array from which images are linked

9 years agoclient: Fix typo
Bryce Harrington [Tue, 17 Mar 2015 22:09:30 +0000 (15:09 -0700)]
client: Fix typo

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agocursor: add wl_cursor_frame_and_duration
Derek Foreman [Wed, 4 Mar 2015 20:30:41 +0000 (14:30 -0600)]
cursor: add wl_cursor_frame_and_duration

It's useful to know how long the current cursor frame should be displayed
so we can wait that long to change it.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoprotocol: Change wording of subsurface placement scheduling
Jonas Ådahl [Tue, 3 Mar 2015 07:40:58 +0000 (15:40 +0800)]
protocol: Change wording of subsurface placement scheduling

Change wording to be more consistent with other parts of the subsurface
protocol. Before this change, wl_subsurface.set_position explicitly
stated that the new state was to be applied on the parents
wl_surface.commit and wl_subsurface.place_above/below only said "on
the next commit of the parent surface". What "committed" means is
ambiguous considering that a wl_surface.commit actually defers the
actual commit when in synchronized mode, but the intention has always
been that placement of a subsurface should be considered part of its
content, i.e. placement state should be applied when other state
(buffer, regions). This patch makes that more clear.

Note that prior to this patch, one could correctly have interpreted
the protocol meaning that placements operations takes effect explicitly
on wl_surface.commit of the parent surface no matter whether other state
of the parent surface is applied at that point. This patch clarifies that
that is not the case.

https://bugs.freedesktop.org/show_bug.cgi?id=88857

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Acked-by: Jasper St. Pierre <jstpierre@mecheye.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agowayland.xml: fixed a typo
Hardening [Wed, 25 Feb 2015 14:03:33 +0000 (15:03 +0100)]
wayland.xml: fixed a typo

9 years agoconfigure.ac: bump version to 1.7.90
Bryce Harrington [Wed, 18 Feb 2015 02:34:33 +0000 (18:34 -0800)]
configure.ac: bump version to 1.7.90

Master is open for new features again

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agoconfigure.ac: bump to version 1.7.0 for release sandbox/boram/wayland170 1.7.0
Bryce Harrington [Sat, 14 Feb 2015 03:17:56 +0000 (19:17 -0800)]
configure.ac: bump to version 1.7.0 for release

9 years agoconfigure.ac: bump to version 1.6.93 for rc2 release 1.6.93
Bryce Harrington [Sat, 7 Feb 2015 01:56:44 +0000 (17:56 -0800)]
configure.ac: bump to version 1.6.93 for rc2 release

9 years agoconfigure.ac: Fallback to older detection code if pkg-config can't find expat
Bill Spitzak [Tue, 3 Feb 2015 22:26:58 +0000 (14:26 -0800)]
configure.ac: Fallback to older detection code if pkg-config can't find expat

This paritally reverts commit a4afd90f9f0c27ed5f3f313b915c260673f8be34.

On older expat versions (ie the one on Ubuntu 12.04) there is no pkg-config
file, so fall back to a test for the header and library. In addition the
source for expat does not seem to be in a git repository but in cvs instead
and it seems preferrable to not require cvs to build wayland.

The restored test has been updated to use AC_SEARCH_LIBS. This version
uses empty square brackets for the unused branches, similar to many other
if statements in configure.ac.
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Andrew Oakley <aoakley@espial.com>
9 years agotests: Fix FAIL in sanity-test (*timeout*) when Yama LSM enabled
Bryce Harrington [Wed, 7 Jan 2015 19:56:54 +0000 (11:56 -0800)]
tests: Fix FAIL in sanity-test (*timeout*) when Yama LSM enabled

This fixes a regression in the testsuite since c3653f7f, where four of
the timeout tests fail with "Timeouts suppressed" messages.

The timeouts are being suppressed because the testsuite is erroneously
detecting that a debugger is attached.  This detection mechanism
(adopted from libinput) uses ptrace to test if there is a debugger
parent process that can be attached.  Unfortunately, this is an
unreliable test: Kernel security policies exist to restrict the scope of
ptrace to prevent processes from snooping on one another.[1] This
security policy is set as the default on Ubuntu, and potentially other
Linux distributions.[2]

The Yama documentation suggests, "For software that has defined
application-specific relationships between a debugging process and its
inferior (crash handlers, etc), prctl(PR_SET_PTRACER, pid, ...) can be
used.  An inferior can declare which other process (and its descendents)
are allowed to call PTRACE_ATTACH against it."  This prctl call has no
effect if Yama LSM is not loaded.

The child needs to be synchronized to the client to prevent a race
condition where the child might try to operate before the parent has
finished its prctl call.  This synchronization is done via pipes.

This patch can be tested by running sanity-test with
/proc/sys/kernel/yama/ptrace_scope set to 0 or 1; the test must pass for
either value.

1: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=2d514487faf188938a4ee4fb3464eeecfbdcf8eb
2: https://wiki.ubuntu.com/SecurityTeam/Roadmap/KernelHardening#ptrace_Protection

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
v4: Allow parent to communicate error state to child to prevent leaving
child in zombie state if parent hits an error.

v5: Check errno instead of rc for error.  Don't waitpid on ppid.
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agodoc: Fill in high level description for Surfaces
Bryce Harrington [Wed, 28 Jan 2015 00:32:16 +0000 (16:32 -0800)]
doc: Fill in high level description for Surfaces

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
9 years agotest-runner: wait for concrete pid
Marek Chalupa [Mon, 2 Feb 2015 09:40:21 +0000 (10:40 +0100)]
test-runner: wait for concrete pid

After running a test in fork, we were waiting for any child to terminate.
It is OK unless the child forks again. If the child calls fork, the waitid can
catch the child's child termination, stop block and run another test
while the former test is still running. This is racy i. e. when adding socket.
Since we have test compositor which uses fork, this situation can occur
pretty frequently.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agoconfigure.ac: re-bump version to 1.6.92 for rc1 release 1.6.92
Bryce Harrington [Sat, 31 Jan 2015 03:04:07 +0000 (19:04 -0800)]
configure.ac: re-bump version to 1.6.92 for rc1 release

9 years agodoc: Fix out-of-tree build and also distcheck
Jon Cruz [Sat, 31 Jan 2015 02:07:24 +0000 (18:07 -0800)]
doc: Fix out-of-tree build and also distcheck

Corrects an issue that would cause out-of-tree builds to fail and also
a few items that would cause distcheck to fail.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agoconfigure.ac: bump version to 1.6.92 for rc1 release
Bryce Harrington [Fri, 30 Jan 2015 22:57:53 +0000 (14:57 -0800)]
configure.ac: bump version to 1.6.92 for rc1 release

9 years agogitignore: Add the new cpp-compile-test
Bryce Harrington [Fri, 30 Jan 2015 01:25:16 +0000 (17:25 -0800)]
gitignore:  Add the new cpp-compile-test

9 years agodoc: Intro text for doxygen output in it's own file
Bill Spitzak [Thu, 29 Jan 2015 02:44:08 +0000 (18:44 -0800)]
doc: Intro text for doxygen output in it's own file

(This patch has been modified to apply atop current master)

This makes it considerably easier to edit the text and make it different
for each library.

To address previous concerns with this patch, I wrote some more complete
introductory text. This is based on my understanding of these libraries, which
may not be correct, and is pretty rudimentary for libwayland-server!

However this intro text demonstrates how to create links to the
doxygen-generated text. It looks like you cannot link to methods easily as the
link name contains a hash number, but links to objects and classes work.
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
Tested-by: Jon A. Cruz <jonc@osg.samsung.com>
9 years agoconfigure.ac: use pkg-config to find expat
Andrew Oakley [Tue, 27 Jan 2015 17:18:13 +0000 (17:18 +0000)]
configure.ac: use pkg-config to find expat

This is now done in the same way as the libffi dependency and still
allows the library to be installed in a non-standard location (with
PKG_CONFIG_PATH).

9 years agodoc/publican/Makefile.am: Add a missing order-only prerequisite
Rui Matos [Tue, 6 Jan 2015 16:35:56 +0000 (17:35 +0100)]
doc/publican/Makefile.am: Add a missing order-only prerequisite

Otherwise a parallel make invocation could fail due to the directory
not existing.

Signed-off-by: Rui Matos <tiagomatos@gmail.com>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
9 years agoevent-loop: Dispatch idle callbacks twice
Derek Foreman [Wed, 28 Jan 2015 15:25:03 +0000 (09:25 -0600)]
event-loop: Dispatch idle callbacks twice

To fix a shutdown crash in weston's x11 compositor I want to move the
weston X window close to an idle handler.

Since idle handlers are processed at the start of an event loop, the
handler that deals with window close will run at the start of the
next input_loop dispatch, after which the dispatcher blocks on epoll
forever (since all input events that will ever occur have been consumed).

Dispatching idle callbacks both at the start and end of event-loop
processing will prevent this permanent blocking.

Note that just moving the callback dispatch could theoretically
result in an idle callback being delayed indefinitely while waiting
for epoll_wait() to complete.

Callbacks are removed from the list when they're run, so the second
dispatch won't result in any extra calls.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agodoc: update diagrams for compatibility.
Jon Cruz [Thu, 29 Jan 2015 01:24:06 +0000 (17:24 -0800)]
doc: update diagrams for compatibility.

Change attribute separators for compatiblity with graphviz older than 2.30.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
9 years agodoc: Create hot-linked areas in documents.
Jon Cruz [Thu, 29 Jan 2015 01:24:05 +0000 (17:24 -0800)]
doc: Create hot-linked areas in documents.

Added xslt processing to give DocBook output diagram image maps/hot-linked
areas consistent with those automatically generated by Doxygen.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
9 years agodoc: Switch from static image files to generated diagrams.
Jon Cruz [Thu, 29 Jan 2015 01:24:04 +0000 (17:24 -0800)]
doc: Switch from static image files to generated diagrams.

Switches diagrams from using static PNG images to instead generate them via
simple graphviz DOT markup files.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
9 years agodisplay-test: disable leak check in tests that use pthread
Marek Chalupa [Fri, 19 Dec 2014 13:53:07 +0000 (14:53 +0100)]
display-test: disable leak check in tests that use pthread

pthread is leaking and it makes our tests fail.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agotests: add possibility to disable leak check for single test
Marek Chalupa [Fri, 19 Dec 2014 13:53:06 +0000 (14:53 +0100)]
tests: add possibility to disable leak check for single test

In tests that are using external libraries (i. e. pthread) we
can get failure because of leaks in the external library.
Until we have some better solution (if ever), let these (and only these)
tests to disable leak checks.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agoclient: unref or destroy proxy when releasing queue
Marek Chalupa [Fri, 19 Dec 2014 13:53:05 +0000 (14:53 +0100)]
client: unref or destroy proxy when releasing queue

When we release event queue with queued events, we can leak
proxies in some cases.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agoclient: release display queue in wl_display_disconnect()
Marek Chalupa [Fri, 19 Dec 2014 13:53:04 +0000 (14:53 +0100)]
client: release display queue in wl_display_disconnect()

Don't leak events, not even on exit

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agoconnection-test: add tests for closure leaks
Marek Chalupa [Fri, 19 Dec 2014 13:53:03 +0000 (14:53 +0100)]
connection-test: add tests for closure leaks

When we destroy closure, we are leaking memory sometimes.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agotests: add tests for leak check in clients
Marek Chalupa [Fri, 19 Dec 2014 13:53:02 +0000 (14:53 +0100)]
tests: add tests for leak check in clients

Sanity tests for leak checks in clients of test compositor
and also check if the test-compositor itself is not leaking
anything.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agotest-compositor: extend leak checks into clients
Marek Chalupa [Fri, 19 Dec 2014 13:53:01 +0000 (14:53 +0100)]
test-compositor: extend leak checks into clients

Run leak checks also on clients of test-compositor.

Checking leaks in memory is the same as in normal TEST.

Checking file descriptor leaks is slightly more complex, as we pass an
open file descriptor in the WAYLAND_SOCKET environment variable, which
will be consumed by a client calling wl_display_connect(), but otherwise
remain unused. We manage this accounting by checking if the environment
variable has been unset by wl_display_connect() as it consumes the
socket.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
[daniels: squashed counter-proposal patch to simplify fd leak checking,
          plus Bill's counter-counter-proposal, and reworded log.]

9 years agotest-runner: move leak checking into function
Marek Chalupa [Fri, 19 Dec 2014 13:53:00 +0000 (14:53 +0100)]
test-runner: move leak checking into function

1) now we can use it in the test-compositor
2) it looks better

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agoscanner: Fix header generation for server protocols
Mariusz Ceier [Mon, 15 Dec 2014 11:48:38 +0000 (12:48 +0100)]
scanner: Fix header generation for server protocols

Server protocols headers should include wayland-server.h,
instead of wayland-util.h. Otherwise they're not useable
with C++ compiler unless wayland-server.h was included
earlier.

Signed-off-by: Mariusz Ceier <mceier+wayland@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agotests: C++ compilation test
Mariusz Ceier [Mon, 15 Dec 2014 10:33:53 +0000 (11:33 +0100)]
tests: C++ compilation test

This test includes one of wayland headers, which produced
error with C++ compiler. C compiler can't be used for this test,
because it issues only a warning[1] and only when wayland headers
are not installed in system headers path (/usr/include).

[1] wayland-server-protocol.h:201:2: warning: implicit declaration of function ‘wl_resource_post_event’

[daniels: Merged in Marek's follow-up to check for a C++ compiler.]

Signed-off-by: Mariusz Ceier <mceier+wayland@gmail.com>
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
9 years agotests: Correct return code handling
Bryce Harrington [Sat, 10 Jan 2015 00:05:12 +0000 (16:05 -0800)]
tests: Correct return code handling

Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agotests: Fix typo "evnironment"
Bryce Harrington [Sat, 10 Jan 2015 00:05:11 +0000 (16:05 -0800)]
tests: Fix typo "evnironment"

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
9 years agodoc: Put a dash between type/enum value and description
Bill Spitzak [Sat, 24 Jan 2015 01:41:08 +0000 (17:41 -0800)]
doc: Put a dash between type/enum value and description

This was suggested by Derek Foreman, I think it looks better

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agodoc: Add macros and typedefs to the documentation
Bill Spitzak [Sat, 24 Jan 2015 01:41:07 +0000 (17:41 -0800)]
doc: Add macros and typedefs to the documentation

If somebody bothered to put a doxygen comment in for a macro or
typedef, make it appear in the pages. This produces documentation
for wl_container_of and wl_dispatcher_func_t from the _8h files.

Reviewed-by: "Jon A. Cruz" <jonc@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agodoc: there is no need to move the _8h files
Bill Spitzak [Sat, 24 Jan 2015 01:41:06 +0000 (17:41 -0800)]
doc: there is no need to move the _8h files

The current xslt skips all the data that is in them, so it is ok
if they are included.

Reviewed-by: "Jon A. Cruz" <jonc@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agocosmetic: Cleanup trailing whitespace
Bryce Harrington [Mon, 26 Jan 2015 19:30:57 +0000 (11:30 -0800)]
cosmetic: Cleanup trailing whitespace

9 years agocosmetic: Move the deprecated functions back to the end of the file
Derek Foreman [Sat, 24 Jan 2015 15:24:23 +0000 (09:24 -0600)]
cosmetic: Move the deprecated functions back to the end of the file

There are functions below the "Deprecated functions below" comment
that are not deprecated.

Move the deprecated functions back down, and add a comment at the
end of the file to try to keep this from happening again.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
9 years agodoc: remove redundant subtitles
Bill Spitzak [Sat, 3 Jan 2015 02:29:22 +0000 (18:29 -0800)]
doc: remove redundant subtitles

Put the argument lists next to the event/message title, which I
think makes it a lot easier to understand, and remove redundant
"values" title from enumerations.

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agodoc: Add object types and links to arguments int protocol documentation
Bill Spitzak [Sat, 3 Jan 2015 02:29:21 +0000 (18:29 -0800)]
doc: Add object types and links to arguments int protocol documentation

This makes it a lot easier to figure out what is going on!

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agodoc: compress the lists in the protocol docs some
Bill Spitzak [Sat, 3 Jan 2015 02:29:20 +0000 (18:29 -0800)]
doc: compress the lists in the protocol docs some

Use simpara to remove the blank lines, and put the type/value and
the comment into the same line.

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agodoc: made functions taking wl_event_queue arg belong to wl_event_queue
Bill Spitzak [Sat, 3 Jan 2015 02:29:18 +0000 (18:29 -0800)]
doc: made functions taking wl_event_queue arg belong to wl_event_queue

The fact that these functions take both a display and queue argument is
I think historical, and they really are methods on the queue.

Also added some docs for wl_display_prepare_read_queue.

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agodoc: Remove wl_map from documentation
Bill Spitzak [Sat, 3 Jan 2015 02:29:17 +0000 (18:29 -0800)]
doc: Remove wl_map from documentation

This object is only in wayland-private.h so it's methods should not
be in the documentation.

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agodoc: Remove deprecated functions from documentation
Bill Spitzak [Sat, 3 Jan 2015 02:29:16 +0000 (18:29 -0800)]
doc: Remove deprecated functions from documentation

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agodoc: add missing \memberof to wl_display_get_protocol_error
Bill Spitzak [Sat, 3 Jan 2015 02:29:15 +0000 (18:29 -0800)]
doc: add missing \memberof to wl_display_get_protocol_error

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agoserver: Use existing id variable when inserting created object
Jonas Ådahl [Fri, 23 Jan 2015 08:21:15 +0000 (16:21 +0800)]
server: Use existing id variable when inserting created object

We already have the id variable there and it makes it slightly easier to
read.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agoprotocol: Clarify selection data offer destruction requirement
Jonas Ådahl [Fri, 23 Jan 2015 08:21:14 +0000 (16:21 +0800)]
protocol: Clarify selection data offer destruction requirement

Clarify that a client receiving a wl_data_device.selection event must
destroy the data_offer of the previous wl_data_device.selection event,
if any.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
9 years agoprotocol: Fix typo in wl_data_offer
Jonas Ådahl [Fri, 23 Jan 2015 08:21:13 +0000 (16:21 +0800)]
protocol: Fix typo in wl_data_offer

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
9 years agoconfigure.ac: bump version to 1.6.91 for the alpha release 1.6.91
Bryce Harrington [Sat, 17 Jan 2015 11:39:05 +0000 (03:39 -0800)]
configure.ac: bump version to 1.6.91 for the alpha release

9 years agodoc: make itemized lists from doxygen work
Bill Spitzak [Fri, 19 Dec 2014 04:15:10 +0000 (20:15 -0800)]
doc: make itemized lists from doxygen work

Not actually used currently but probably a good idea.

Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agodoc: Document structures and unions in addition to classes
Bill Spitzak [Fri, 19 Dec 2014 04:15:08 +0000 (20:15 -0800)]
doc: Document structures and unions in addition to classes

This provides targets for some of the doxygen links, and some of
them have useful memberof function lists.

Added some if/else statements to reduce validation errors.

Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agodoc: Each class in doxygen output is a section
Bill Spitzak [Fri, 19 Dec 2014 04:15:07 +0000 (20:15 -0800)]
doc: Each class in doxygen output is a section

All the methods belonging to the class are listed with it, making
it much easier to find them.

I dumped all other functions into a section called "Functions" at
the end.

Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agodoc: removed the word "interface" from the link names
Bill Spitzak [Fri, 19 Dec 2014 04:15:06 +0000 (20:15 -0800)]
doc: removed the word "interface" from the link names

Just to make it slightly shorter.

Also add a dash to the doxygen links to make them look a bit more alike.

Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agodoc: Reduce the validation errors of the docbook input
Bill Spitzak [Fri, 19 Dec 2014 04:15:05 +0000 (20:15 -0800)]
doc: Reduce the validation errors of the docbook input

(this is different from previous version as it removes some
broken and irrelevant changes to the protocol appendix).

This removes all the validation errors except for missing link
targets. You can test this by removing the --skip-validation
from doc/publican/Makefile.am.

Main changes are to avoid nesting <para> commands. I also used
<simpara> in some places to reduce the amount of blank space.
And the reference id's are prefixed with the chapter name to
avoid collisions between libclient and libserver.

PS: it would be useful if somebody who actually knows something
about xslt would come up with a way to translate a block of text
makde of <para> commands unchanged, but add <para> around plain
text. Most of the difficulty is that doxygen's output is rather
inconsistent here.

Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agofixup doc: Make it easier to add a new doxygen page
Bill Spitzak [Wed, 17 Dec 2014 03:52:10 +0000 (19:52 -0800)]
fixup doc: Make it easier to add a new doxygen page

This supersedes the previous one and fixes a typo where a slash was missing.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agodoc: Make it easier to add a new doxygen page
Bill Spitzak [Wed, 17 Dec 2014 03:23:03 +0000 (19:23 -0800)]
doc: Make it easier to add a new doxygen page

The repetitive parts of generating the server and client documentation are
merged, so it is easier to add another doxygen chapter: add a new line to
$publican_sources in publican/Makefile.am, and a list of C source files to
doxygen/Makefile.am.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agodoc: fix for parallel make
Bill Spitzak [Wed, 17 Dec 2014 03:23:02 +0000 (19:23 -0800)]
doc: fix for parallel make

Move the *_8h.xml files to a per-chapter temporary file so two
chapters can be converted from doxygen at the same time. Tested
with make -j 9.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agodoc: Split libwayland-client and -server into different pages
Bill Spitzak [Wed, 10 Dec 2014 01:01:12 +0000 (17:01 -0800)]
doc: Split libwayland-client and -server into different pages

This was suggested before to make it clearer that things like wl_display
are different objects in each of them. I made these into two appendixes
because the protocol spec was already an appendix.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
[Bryce requested minor changes, not yet here.]

Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agodoc: fix doxygen->man command line
Bill Spitzak [Wed, 10 Dec 2014 01:01:11 +0000 (17:01 -0800)]
doc: fix doxygen->man command line

It was telling it to scan the doxyfile as well as the C source, and
listing some source files more than once.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agodoc: Minor makefile cleanup.
Jon A. Cruz [Tue, 9 Dec 2014 09:34:23 +0000 (01:34 -0800)]
doc: Minor makefile cleanup.

Split out directory creation to leverage order only prerequisites.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agodoc: General makefile cleanup.
Jon A. Cruz [Tue, 9 Dec 2014 09:34:22 +0000 (01:34 -0800)]
doc: General makefile cleanup.

This is a general cleanup of the makefile in order to bring it more inline
with standard make practices. Cleanups included more use of automatic
variables, switching AM_V_GEN to AM_V_at to have one 'GEN' visible per file,
splitting copy operations to proper rules, and using order only dependencies
to properly create directories on-demand.

Changes also correct missing use of $(builddir) that has gone unnoticed as
it defaults to the current directory ('.').

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoclient: update documentation about threading
Marek Chalupa [Fri, 5 Dec 2014 13:00:05 +0000 (14:00 +0100)]
client: update documentation about threading

Remove out-dated documentation and add few more words
about this topic.

v2. replace a paragraph by better explanation from Pekka Paalanen
    fix other notes from reviewing

v3. fix typo

v4. fix flags for poll in an example

    add wl_display_cancel_read() to another example
    (so that user sees that it should be used)

    move proper use of wl_display_prepare_read
    before the explanation why it is wrong to use
    wl_display_displach

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
9 years agoclient: update obsolete comments
Marek Chalupa [Wed, 3 Dec 2014 14:53:16 +0000 (15:53 +0100)]
client: update obsolete comments

1) there is nothing like main thread since
   3c7e8bfbb4745315b7bcbf69fa746c3d6718c305 anymore, so remove
   it from documentation and update the doc accordingly.

2) use calling 'default queue' instead of 'main queue'. In the code
   we use display->default_queue, so it'll be easier the understand.

3) update some obsolete or unprecise pieces of documentation

v2. Not only remove out-of-date comment, but fix/remove more
    things across the wayland-client.[ch]

v3. fixes (rephrasing unclear paragraphs etc.)
    according to Pakka Paalanen notes (thanks)

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
9 years agodoc: Add config check for doxygen 1.6.0+.
Jon A. Cruz [Thu, 4 Dec 2014 02:26:26 +0000 (18:26 -0800)]
doc: Add config check for doxygen 1.6.0+.

Add a config time check for a new enough (1.6.0+) version of doxygen.

v2. require 1.6.0+ instead of 1.8.0+

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agodoc: Remove duplicated descriptions of wayland objects
Bill Spitzak [Wed, 3 Dec 2014 02:29:36 +0000 (18:29 -0800)]
doc: Remove duplicated descriptions of wayland objects

This text is a duplicate of the text in the protocol documentation, but
the converter mangled it by removing the paragraph breaks and some other
errors. Instead replace it with a list of links to the protocol docs.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agodoc: removed redundant dependency
Bill Spitzak [Wed, 3 Dec 2014 02:29:35 +0000 (18:29 -0800)]
doc: removed redundant dependency

The .tmp file dependency depends on the index.xml file so it does not need to
be repeated.

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agodoc: Invoke doxygen via the defined make variable.
Jon A. Cruz [Wed, 3 Dec 2014 01:54:07 +0000 (17:54 -0800)]
doc: Invoke doxygen via the defined make variable.

Invoke doxygen via the autoconf-defined make variable instead of directly.
This brings it in line with standard makefile practices.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agodoc: Removed redundant xslt output elements.
Jon A. Cruz [Thu, 27 Nov 2014 20:30:52 +0000 (12:30 -0800)]
doc: Removed redundant xslt output elements.

Removed <xsl:output> elements that were duplicated but with attributes in
a different order. Standard tools are required to ignore the order of
attributes in an element.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
9 years agotests: fix memory leak
Marek Chalupa [Fri, 21 Nov 2014 10:18:33 +0000 (11:18 +0100)]
tests: fix memory leak

We didn't free the struct client that we got from client_connect()

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agotests: split queue-test testcases
Marek Chalupa [Fri, 21 Nov 2014 10:15:24 +0000 (11:15 +0100)]
tests: split queue-test testcases

All the test-cases are in one test atm. It doesn't matter for the
outcome, but when it is split to more tests, the debugging and reading
the output is simpler.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agotests: detect if debugger is attached
Marek Chalupa [Fri, 28 Nov 2014 14:36:52 +0000 (15:36 +0100)]
tests: detect if debugger is attached

Copy function from libinput/test/litest.c is_debugger_detached()
and use it in our test-runner. If debugger is attached, turn off
leak checks and timeouts automatically.

Revision of libinput: 028513a0a723e97941c39c4aeb17433198723913

v2. rebased to master

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agotests: use color when printing on terminal
Marek Chalupa [Fri, 28 Nov 2014 12:18:20 +0000 (13:18 +0100)]
tests: use color when printing on terminal

Colorize output of the tests when prinitng on terminal.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agotest-runner: print separator line after each test-case
Marek Chalupa [Fri, 21 Nov 2014 10:34:07 +0000 (11:34 +0100)]
test-runner: print separator line after each test-case

Who can read the output when it is a single piece of text?

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
9 years agotests: rename env vars for tests
Marek Chalupa [Fri, 28 Nov 2014 08:41:50 +0000 (09:41 +0100)]
tests: rename env vars for tests

Rename WAYLAND_TESTS_NO_TIMEOUTS to WAYLAND_TEST_NO_TIMEOUTS.
Further rename NO_ASSERT_LEAK_CHECK to WAYLAND_TEST_NO_LEAK_CHECK.
Now the naming is consistent not only here, in Wayland, but even with
naming of weston env varibles related to testing.

This is version 2 of the patch. The first version just renamed
NO_ASSERT_LEAK_CHECK to WAYLAND_TEST_NO_LEAK_CHECK.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Bryce Harrington <b.harrington@samsung.com>
9 years agoscanner.c: Use WL_PRINTF instead of __attribute__((format(printf)))
Seedo Eldho Paul [Thu, 27 Nov 2014 15:20:14 +0000 (20:50 +0530)]
scanner.c: Use WL_PRINTF instead of __attribute__((format(printf)))

Signed-off-by: Seedo Eldho Paul <seedoeldhopaul@gmail.com>
9 years agodoc: fixed grammar and a typo
Derek Foreman [Mon, 17 Nov 2014 20:59:14 +0000 (14:59 -0600)]
doc: fixed grammar and a typo

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
9 years agodoc: Removed extra indentation from wl_list code sample
Bill Spitzak [Wed, 26 Nov 2014 01:41:03 +0000 (17:41 -0800)]
doc: Removed extra indentation from wl_list code sample

This is a minor documentation fix. I did not see any asterisks in the
output as reported by Pekka Paalanen. Using doxygen 1.7.6.1.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agodoc: Removed \ref when it refers to the subject the text is attached to
Bill Spitzak [Wed, 12 Nov 2014 02:43:02 +0000 (18:43 -0800)]
doc: Removed \ref when it refers to the subject the text is attached to

This does not make a difference to doxygen output but may help other
document generators not make redundant links.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
9 years agodoc: fixed a typo
Bill Spitzak [Wed, 12 Nov 2014 02:43:01 +0000 (18:43 -0800)]
doc: fixed a typo

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
9 years agov4 doc: fixed reference to non-existent function
Bill Spitzak [Thu, 13 Nov 2014 22:46:51 +0000 (14:46 -0800)]
v4 doc: fixed reference to non-existent function

(Fixed to remove accidental commit of another change)

After some feedback from Marek Chalupa I decided to just remove this. There
were suggestions about warning about multiple threads but it appears this
would be true for many of these functions and thus it would be misleading to
mention multiple threads only here (as it would imply that multiple threads
work for other functions which is not true, I think).

Acked-by: Marek Chalupa <mchqwerty@gmail.com>
9 years agodoc: Added \code tags around sample code in doxygen comments
Bill Spitzak [Wed, 12 Nov 2014 02:42:59 +0000 (18:42 -0800)]
doc: Added \code tags around sample code in doxygen comments

Also removed \comment and used C++ comments. There does not appear
to be any other way to put comments into code samples.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
9 years agodoc: removed some unnecessary nested listing from doxygen output
Bill Spitzak [Wed, 12 Nov 2014 02:42:58 +0000 (18:42 -0800)]
doc: removed some unnecessary nested listing from doxygen output

This makes the lists of parameters slightly smaller and removes some
bullets from see-also and since.

9 years agodoc: Don't print dash if doxygen brief description missing
Bill Spitzak [Wed, 12 Nov 2014 02:42:57 +0000 (18:42 -0800)]
doc: Don't print dash if doxygen brief description missing

9 years agodoc: preserve links produced by Doxygen
Bill Spitzak [Wed, 12 Nov 2014 02:42:56 +0000 (18:42 -0800)]
doc: preserve links produced by Doxygen

These links are pretty useful for navigation, though sometimes excessive
(you can turn them off by putting % before the word in the comment).

I had to turn off validation because it failed on missing and duplicate
target id's, which this produces.

9 years agodoc: Preserve spaces
Bill Spitzak [Wed, 12 Nov 2014 02:42:55 +0000 (18:42 -0800)]
doc: Preserve spaces

Slight variation on Pekka's patch. It seems harmless to put this anywhere.

9 years agodoc: make rebuilds doxygen output on code changes
Bill Spitzak [Wed, 12 Nov 2014 02:42:54 +0000 (18:42 -0800)]
doc: make rebuilds doxygen output on code changes

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
9 years agoserver: increase listen queue to 128
Imran Zaman [Mon, 24 Nov 2014 14:10:49 +0000 (16:10 +0200)]
server: increase listen queue to 128

This will allow more than 1 simultaneous client connections to the server
without the possibility of connection refused error.

Signed-off-by: Imran Zaman <imran.zaman@gmail.com>
http://utcc.utoronto.ca/~cks/space/blog/unix/ListenBacklogMeaning
http://stackoverflow.com/questions/19221105/connect-with-unix-domain-socket-and-full-backlog
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoclient: read_events should return -1 after an error
Marek Chalupa [Mon, 27 Oct 2014 08:19:46 +0000 (09:19 +0100)]
client: read_events should return -1 after an error

When a thread is sleeping, waiting until another thread read
from the display, it always returns 0. Even when an error
occured. In documentation stands:

  "return 0 on success or -1 on error.  In case of error errno will
   be set accordingly"

So this is a fix for this.

Along with the read_events, fix a test so that it now complies
with this behaviour (and we have this tested)

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agogitignore: adpat to scanner and protocol path changes
Olivier Blin [Wed, 22 Oct 2014 16:44:59 +0000 (18:44 +0200)]
gitignore: adpat to scanner and protocol path changes

Since commit 4c163b9b001bd93aaf97d7e962873a379eb90bfd, wayland-scanner
is built in top builddir instead of src, and protocol files are
generated in protocol subdir instead of src.
Protocol files generated in the new path are already properly ignored
in the toplevel gitignore file.

Signed-off-by: Olivier Blin <olivier.blin@softathome.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agotests: don't print '\0' character
Marek Chalupa [Wed, 19 Nov 2014 10:58:26 +0000 (11:58 +0100)]
tests: don't print '\0' character

print "" (which results in no output) instead of
printing '\0' (which is not visible, but is there)

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
9 years agoqueue-test: put back timeout
Marek Chalupa [Wed, 24 Sep 2014 12:37:08 +0000 (14:37 +0200)]
queue-test: put back timeout

In 93e654061b9 we removed call to alarm() that served as timeout in this test.
Now when we have test_set_timeout() func, return the timeout back.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
9 years agotests: use test_set_timeout in display-test
Marek Chalupa [Wed, 24 Sep 2014 12:37:07 +0000 (14:37 +0200)]
tests: use test_set_timeout in display-test

replace call to alarm() with test_set_timeout()

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Acked-by: Giulio Camuffo <giuliocamuffo@gmail.com>
9 years agotests: add timeout tests
Marek Chalupa [Wed, 12 Nov 2014 12:14:47 +0000 (13:14 +0100)]
tests: add timeout tests

sanity tests for timeouts.

v2:
  use test_sleep instead of sleep
  add few more test-cases

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agotests: add test_usleep and test_sleep functions
Marek Chalupa [Wed, 12 Nov 2014 12:14:46 +0000 (13:14 +0100)]
tests: add test_usleep and test_sleep functions

The former one was already used in tests, but was private.
These functions can be shared across the tests, so make them
public.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agotests: add timeout
Marek Chalupa [Wed, 12 Nov 2014 12:16:42 +0000 (13:16 +0100)]
tests: add timeout

Add test_set_timeout() function that allows the test to
set timeout for its completition. Any other call to the function
re-sets the timeout to the new value. The timeouts can be turned off
(usefull when debugging) by setting evironment variable
WAYLAND_TESTS_NO_TIMEOUTS.

v2:
  rename NO_TIMEOUTS to WAYLAND_TESTS_NO_TIMEOUTS
  use unsigned int as argument of test_set_timeout()
  improve printing of the message about timeout

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoconnection: abort if a listener function is NULL
Ryo Munakata [Wed, 1 Oct 2014 12:17:18 +0000 (21:17 +0900)]
connection: abort if a listener function is NULL

Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoRemove useless semicolon.
Carlos Olmedo Escobar [Wed, 12 Nov 2014 02:19:03 +0000 (03:19 +0100)]
Remove useless semicolon.

Signed-off-by: Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
9 years agodoc: Added API documentation for wl_display_destroy and wl_display_add_socket functions.
Srivardhan Hebbar [Wed, 15 Oct 2014 09:21:27 +0000 (14:51 +0530)]
doc: Added API documentation for wl_display_destroy and wl_display_add_socket functions.

Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
[Pekka Paalanen: minor re-wording.]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>