platform/upstream/wayland.git
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>
9 years agoDon't document an absent parameter.
Bryce Harrington [Thu, 30 Oct 2014 07:52:39 +0000 (00:52 -0700)]
Don't document an absent parameter.

Quells a doxygen warning:

  src/wayland-server.c:790: warning: argument 'None' of command @param is
  not found in the argument list of wl_display::wl_display_create(void)

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
9 years agoscanner, client: Added more error checks when strtol function is used
Imran Zaman [Wed, 5 Nov 2014 15:40:18 +0000 (17:40 +0200)]
scanner, client: Added more error checks when strtol function is used

Signed-off-by: Imran Zaman <imran.zaman@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agotests: use our own XDG_RUNTIME_DIR for tests
Marek Chalupa [Wed, 24 Sep 2014 12:07:59 +0000 (14:07 +0200)]
tests: use our own XDG_RUNTIME_DIR for tests

Use $XDG_RUNTIME_DIR/wayland-tests for tests. This way we won't be
messing XDG_RUNTIME_DIR and it also fixes a bug, when socket-test
failed when another compositor was running.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoqueue-test: Add another assertion
Philip Withnall [Sat, 1 Nov 2014 17:06:46 +0000 (17:06 +0000)]
queue-test: Add another assertion

Ensure that the round trip succeeds.

Signed-off-by: Philip Withnall <philip at tecnocode.co.uk>
Signed-off-by: Karsten Otto <ottoka at posteo.de>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agowayland-server: Abort if a read from a client gives 0 length
Philip Withnall [Sat, 1 Nov 2014 17:06:29 +0000 (17:06 +0000)]
wayland-server: Abort if a read from a client gives 0 length

This happens on EOF if using a poll function such as select() or
kqueue() which doesn’t distinguish EOF events.

Currently execution should never reach the point where recvmsg() returns
EOF (len == 0). Instead, epoll() will detect this and indicate EPOLLHUP,
which is handled a few lines above, closing the connection. However,
other event mechanisms may not be able to distinguish EOF from regular
readability (in the case of select()) or inconsistently across platforms
(in the case of POLLHUP). There is also the possibility of half-closed
connections (shutdown(), POLLRDHUP), though this may not be an issue
with Wayland.

This will not cause problems if the FD polls as readable but actually is
not — in that case, recvmsg() will return EAGAIN.

Signed-off-by: Philip Withnall <philip at tecnocode.co.uk>
Signed-off-by: Karsten Otto <ottoka at posteo.de>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoevent-loop.c: Use correct OS abstraction function for dupfd()
Philip Withnall [Sat, 1 Nov 2014 17:06:38 +0000 (17:06 +0000)]
event-loop.c: Use correct OS abstraction function for dupfd()

Signed-off-by: Philip Withnall <philip at tecnocode.co.uk>
Signed-off-by: Karsten Otto <ottoka at posteo.de>
Reviewed-by: David Fort <contact at hardening-consulting.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoconnection: Fix sendmsg() on FreeBSD
Philip Withnall [Mon, 3 Nov 2014 09:49:03 +0000 (09:49 +0000)]
connection: Fix sendmsg() on FreeBSD

It expects ((msg_controllen == 0) == (msg_control == NULL)), and returns
EINVAL otherwise. It can't hurt to be tidy about things on other platforms
either though.

See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=99356#c5

Signed-off-by: Philip Withnall <philip at tecnocode.co.uk>
Signed-off-by: Karsten Otto <ottoka at posteo.de>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoProtocol : Added destructor to wl_data_device interface
kabeer khan [Mon, 13 Oct 2014 05:04:26 +0000 (10:34 +0530)]
Protocol : Added destructor to wl_data_device interface

[Pekka Paalanen: removed trailing whitespace, adjust bz link.]

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=81745
Signed-off-by: kabeer khan <kabeer.khan@samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agocosmetic: convert some function returns from int to bool
Derek Foreman [Fri, 3 Oct 2014 19:39:59 +0000 (14:39 -0500)]
cosmetic: convert some function returns from int to bool

[Pekka Paalanen: change is_nullable_type() return value to bool.]

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoconnection: Leave fd open in wl_connection_destroy
Benjamin Herr [Tue, 30 Sep 2014 12:43:03 +0000 (14:43 +0200)]
connection: Leave fd open in wl_connection_destroy

Calling close() on the same file descriptor that a previous call to
close() already closed is wrong, and racy if another thread received
that same file descriptor as a eg. new socket or actual file.

There are two situations where wl_connection_destroy() would close its
file descriptor and then another function up in the call chain would
close the same file descriptor:

  * When wl_client_create() fails after calling wl_connection_create(),
    it will call wl_connection_destroy() before returning. However, its
    caller will always close the file descriptor if wl_client_create()
    fails.

  * wl_display_disconnect() unconditionally closes the display file
    descriptor and also calls wl_connection_destroy().

So these two seem to expect wl_connection_destroy() to leave the file
descriptor open. The other caller of wl_connection_destroy(),
wl_client_destroy(), does however expect wl_connection_destroy() to
close its file descriptor, alas.

This patch changes wl_connection_destroy() to indulge this majority of
two callers by simply not closing the file descriptor. For the benefit
of wl_client_destroy(), wl_connection_destroy() then returns the
unclosed file descriptor so that wl_client_destroy() can close it
itself.

Since wl_connection_destroy() is a private function called from few
places, changing its semantics seemed like the more expedient way to
address the double-close() problem than shuffling around the logic in
wl_client_create() to somehow enable it to always avoid calling
wl_connection_destroy().

Signed-off-by: Benjamin Herr <ben@0x539.de>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agodoc: Translate doxygen <sp/> tags to spaces
Benjamin Herr [Mon, 29 Sep 2014 15:26:13 +0000 (17:26 +0200)]
doc: Translate doxygen <sp/> tags to spaces

Doxygen represents all spacing in code blocks with <sp/> tags, so these
need to be turned back into spaces.

Signed-off-by: Benjamin Herr <ben@0x539.de>
9 years agodoc: Mostly use apply-templates over value-of
Benjamin Herr [Mon, 29 Sep 2014 15:26:12 +0000 (17:26 +0200)]
doc: Mostly use apply-templates over value-of

xsl:value-of would strip all the nested markup of the selected doxygen
elements, so that \ref, \sa and \code formatting didn't actually work.

Signed-off-by: Benjamin Herr <ben@0x539.de>
9 years agodoc: Mark up some code examples
Benjamin Herr [Mon, 29 Sep 2014 15:26:11 +0000 (17:26 +0200)]
doc: Mark up some code examples

These blocks were misformatted in normal paragraph style in the
generated docs. Also, added \comment{} for comments within one code
example.

Signed-off-by: Benjamin Herr <ben@0x539.de>
9 years agoREADME: Tiny cosmetic change
Daniel Stone [Wed, 8 Oct 2014 11:20:08 +0000 (12:20 +0100)]
README: Tiny cosmetic change

9 years agoprotocol: define error codes for role reassignment
Pekka Paalanen [Wed, 1 Oct 2014 09:52:22 +0000 (12:52 +0300)]
protocol: define error codes for role reassignment

On the interfaces where it was missing:
- wl_data_device
- wl_shell
- wl_pointer
add an error code for requests that set a wl_surface role when the
wl_surface already has a different role.

This is needed for compositors to appropriately report wl_surface
role violations.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Acked-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoprotocol: wl_shell.get_shell_surface gives a role
Pekka Paalanen [Thu, 21 Aug 2014 09:50:50 +0000 (12:50 +0300)]
protocol: wl_shell.get_shell_surface gives a role

Now that we have defined "role", use the term.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoprotocol: wl_subcompositor.get_subsurface gives a role
Pekka Paalanen [Thu, 21 Aug 2014 09:42:50 +0000 (12:42 +0300)]
protocol: wl_subcompositor.get_subsurface gives a role

Reword the conditions to make use of the definition of "role".

It is still forbidden to create more than one wl_subsurface for a
wl_surface at a time.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoprotocol: wl_data_device.start_drag may give a role
Pekka Paalanen [Thu, 21 Aug 2014 09:38:18 +0000 (12:38 +0300)]
protocol: wl_data_device.start_drag may give a role

Now that we have defined "role", use the term.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoprotocol: wl_pointer.set_cursor gives a role
Pekka Paalanen [Thu, 21 Aug 2014 09:32:56 +0000 (12:32 +0300)]
protocol: wl_pointer.set_cursor gives a role

Now that we have defined "role", use the term.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoprotocol: define the concept of wl_surface role
Pekka Paalanen [Mon, 18 Aug 2014 14:07:34 +0000 (17:07 +0300)]
protocol: define the concept of wl_surface role

Define what a role is, and what restrictions there are.

A change to existing behaviour is that a role cannot be changed at all
once set. However, this is unlikely to cause problems, as there is no
reason to re-use wl_surfaces in clients.

v2: give more concrete examples of roles, define losing a role, Jasper
rewrote the paragraph on how a role is set.

v3: make role permanent, there is no such thing as "losing a role".
Re-issuing the same role again must be allowed for wl_pointer.set_cursor
et al. to work.

v4: clarify the semantics of destroying a role object.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoscanner: Remove stray newline
Jonas Ådahl [Mon, 22 Sep 2014 20:11:19 +0000 (22:11 +0200)]
scanner: Remove stray newline

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
9 years agoscanner: Improve XML parse error reporting
Jonas Ådahl [Mon, 22 Sep 2014 20:11:18 +0000 (22:11 +0200)]
scanner: Improve XML parse error reporting

Print the parse error and exit with a failure if expat can't parse the
XML.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
9 years agodoc: replace publican with xmlto
Peter Hutterer [Thu, 4 Sep 2014 07:32:10 +0000 (17:32 +1000)]
doc: replace publican with xmlto

Publican isn't packaged for some distros, xmlto is a lot more common. Most of
what publican provides for us is the stylesheet anyway, so we can just use
xmlto and the publican stylesheet to get roughly the same look.

PDF and XML generation has been dropped, this needs a bit more more effort
than a mere switchover to xmlto.

The top-level directory structure imposed by publican is kept for now
(specifically the Wayland/en-US/html tree). This makes it easier to transition over
for packagers. Note that the list of files inside has changed.

CSS files are taken from publican to keep a uniform look compared to previous
documentations. Stylesheets are licensed under CC0 1.0 Universal license, see
publican/LICENSE:

1.  Files in the datadir/Common_Content directory and its subdirectories are
    licensed under the CC0 1.0 Universal license.

    To the extent possible under law, the developers of Publican waive all
    copyright and related or neighboring rights to the files contained
    in the datadir/Common_Content directory and its subdirectories.

Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoconfigure.ac: bump version to 1.6.90
Pekka Paalanen [Mon, 22 Sep 2014 06:51:20 +0000 (09:51 +0300)]
configure.ac: bump version to 1.6.90

Master is open for new features again.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoconfigure.ac: bump version to 1.6.0 1.6.0
Pekka Paalanen [Fri, 19 Sep 2014 09:36:04 +0000 (12:36 +0300)]
configure.ac: bump version to 1.6.0

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoconfigure.ac: bump version to 1.5.93 for rc2 1.5.93
Pekka Paalanen [Fri, 12 Sep 2014 09:26:50 +0000 (12:26 +0300)]
configure.ac: bump version to 1.5.93 for rc2

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoshm: fix error in comment
Derek Foreman [Wed, 10 Sep 2014 18:46:09 +0000 (13:46 -0500)]
shm: fix error in comment

9 years agoclient: cancel read in wl_display_read_events() when last_error is set
Marek Chalupa [Wed, 10 Sep 2014 10:47:14 +0000 (12:47 +0200)]
client: cancel read in wl_display_read_events() when last_error is set

Calling wl_display_read_events() after an error should be equivalent
to wl_display_cancel_read(), so that display state is consistent.

Thanks to Pekka Paalanen <pekka.paalanen@collabora.co.uk>
for pointing that out.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoclient: wake-up threads on all return paths from read_events
Marek Chalupa [Wed, 10 Sep 2014 10:47:13 +0000 (12:47 +0200)]
client: wake-up threads on all return paths from read_events

If wl_connection_read returned EAGAIN, we must wake up sleeping
threads. If we don't do this and the thread calling
wl_connection_read won't call wl_display_read_events again,
the sleeping threads will sleep indefinitely.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agodisplay-test: test if threads are woken up on EAGAIN
Marek Chalupa [Wed, 10 Sep 2014 10:47:12 +0000 (12:47 +0200)]
display-test: test if threads are woken up on EAGAIN

When wl_connection_read() in wl_display_read_events() returns with EAGAIN,
we want the sleeping threads to be woken up. Test it!

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agotests: use nanosleep instead of usleep
Marek Chalupa [Tue, 9 Sep 2014 09:11:52 +0000 (11:11 +0200)]
tests: use nanosleep instead of usleep

man usleep says that bahaviour of using usleep with SIGALRM signal
is unspecified. So create our own usleep that calls nanosleep instead.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoconfigure.ac: bump version to 1.5.92 for rc1 1.5.92
Pekka Paalanen [Fri, 5 Sep 2014 11:57:03 +0000 (14:57 +0300)]
configure.ac: bump version to 1.5.92 for rc1

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agodoc: Quell warnings about missing man3 directory before its been built
Bryce W. Harrington [Mon, 21 Jul 2014 19:23:49 +0000 (19:23 +0000)]
doc: Quell warnings about missing man3 directory before its been built

The shell command for dist_man3_MANS gets invoked several times during
the make process but before the man pages have been generated, which
causes the following warnings when running `make`:

    find: `man/man3': No such file or directory
    find: `man/man3': No such file or directory
    find: `man/man3': No such file or directory
      GEN    xml/client/index.xml

Despite these error messages, the generated dist tarball contains the
man3 pages as intended, both before and after this patch.

    $ make dist
    $ tar xxf wayland-1.5.90.tar.xz
    $ find wayland-1.5.90/doc/doxygen/man/man3 -name "wl_*.3" | wc -l
    85

Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agodisplay-test: make use of create_thread function
Marek Chalupa [Fri, 29 Aug 2014 09:21:29 +0000 (11:21 +0200)]
display-test: make use of create_thread function

This function is used in one test only, but its functionality can be
used in another tests to (create thread and wait until it is sleeping).
We just need to pass the starting function for the thread as an argument.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoclient: add display_wakeup_threads function
Marek Chalupa [Fri, 29 Aug 2014 09:21:28 +0000 (11:21 +0200)]
client: add display_wakeup_threads function

This helper function wraps the always-repeated pattern:

  display->read_serial++;
  pthread_cond_broadcast(&display->reader_cond);

[Pekka Paalanen: minor whitespace and comment fixes.]

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>

9 years agowayland-client: Initialize newly created wl_proxys to zero
Nils Chr. Brause [Sat, 30 Aug 2014 15:12:26 +0000 (17:12 +0200)]
wayland-client: Initialize newly created wl_proxys to zero

Up until now, newly created wl_proxys (with proxy_create or
wl_proxy_create_for_id) are not initialized properly after memory
allocation. The wl_display object in contrast is. To prevent giving
uninitialized data to the user (e.g. user_data) an appropriate memset
has been added. Also, after a memset members don't have to be
explicitly initialized with zero anymore.

Signed-off-by: Nils Chr. Brause <nilschrbrause@googlemail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agodoc/publican: stop excessive rebuilds
Peter Hutterer [Mon, 1 Sep 2014 23:50:14 +0000 (09:50 +1000)]
doc/publican: stop excessive rebuilds

Traced down to the server/client target always rebuilding, causing a rebuild
of everything else. Rework this so the target name is a file we actually
produce and can check for a timestamp.

Note: this also changes the generated file from the doxygen directory into the
en-US publican path and renames it to (server|client)API.xml.tmp to avoid
copying it into the xml output directory.

9 years agoconfigure.ac: Bump version to 1.5.91 for the alpha release 1.5.91
Pekka Paalanen [Fri, 22 Aug 2014 15:01:35 +0000 (18:01 +0300)]
configure.ac: Bump version to 1.5.91 for the alpha release

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoclient: check for error in wl_display_read_events
Marek Chalupa [Fri, 22 Aug 2014 12:28:59 +0000 (14:28 +0200)]
client: check for error in wl_display_read_events

This prevents from blocking shown in one display test. Also, it
makes sense to not proceed further in the code of the function
when an error ocurred.

v2. set errno
    put note about the errno into wl_display_prepare_read doc
    check for error with mutex locked

v3.
    set errno to display->last_error

    check for the error only in wl_display_read_events. It's sufficient
    as prevention for the hanging and programmer doesn't need to
    check if wl_display_prepare_read (that was previously covered by
    this patch too) returned an error or the queue just was not empty.
    Without the check, it could result in indefinite looping.

Thanks to Pekka Paalanen <pekka.paalanen@collabora.co.uk> for
constant reviewing and discussing this patch.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoclient: broadcast the right pthread_cond variable
Marek Chalupa [Tue, 5 Aug 2014 09:42:01 +0000 (11:42 +0200)]
client: broadcast the right pthread_cond variable

In previous commit we removed unused variables. One of them was
pthread_cond_t that was formerly used when reading from display, but
later was (erroneously) made unused. This patch fixes this error
and is a fix for the failing test introduced few patches ago (tests:
test if thread can block on error)

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agoclient: drop unused event queue cond and list variables
Olivier Blin [Thu, 21 Aug 2014 14:54:21 +0000 (16:54 +0200)]
client: drop unused event queue cond and list variables

The wl_event_queue cond variable has been replaced by the wl_display
reader_cond variable (commit 3c7e8bfbb4745315b7bcbf69fa746c3d6718c305).
This cond variable is never waited for anymore, just
signaled/broadcasted, and thus can be safely removed.

The wl_display event_queue_list and link from wl_event_queue
can be removed as well, since it was only used to iterate over
the event queue list in order to broadcast the now unused cond.

No regression on queue unit tests.

Signed-off-by: Olivier Blin <olivier.blin@softathome.com>
v2: fixed and rebased after 886b09c9a3a9d8672039f09fe7eaf3f2b2b012ca
    added signed-off-by

v3: removed link from wl_event_queue

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
9 years agotests: add test for reading after an error occurred
Marek Chalupa [Tue, 5 Aug 2014 09:39:51 +0000 (11:39 +0200)]
tests: add test for reading after an error occurred

This test shows that it's possible to successfully call wl_display_prepare_read
and wl_display_read_events after an error occurred. That may lead to
deadlock.

When you call prepare read from two threads and then call read_events,
one thread gets sleeping. The call from the other thread will return -1 and invokes
display_fatal_error, but since
we have display->last_error already set, the broadcast is not called and
the sleeping thread sleeps indefinitely.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>