Commit Graph

1857 Commits

Author SHA1 Message Date
Jonas Ådahl
8b2fbf8722 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>
2015-03-04 15:47:48 +08:00
Hardening
99d2775ae9 wayland.xml: fixed a typo 2015-02-25 12:38:26 -08:00
Bryce Harrington
f3a5ca999e configure.ac: bump version to 1.7.90
Master is open for new features again

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2015-02-17 18:34:33 -08:00
Bryce Harrington
8e9d5a1084 configure.ac: bump to version 1.7.0 for release 2015-02-13 19:17:56 -08:00
Bryce Harrington
52d971c924 configure.ac: bump to version 1.6.93 for rc2 release 2015-02-06 17:56:44 -08:00
Bill Spitzak
371a9e0aef configure.ac: Fallback to older detection code if pkg-config can't find expat
This paritally reverts commit a4afd90f9f.

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>
2015-02-06 15:52:50 -08:00
Bryce Harrington
76fe89ed53 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>
2015-02-06 14:39:36 -08:00
Bryce Harrington
310fea467c 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>
2015-02-04 21:49:30 -08:00
Marek Chalupa
8094426a41 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>
2015-02-04 19:43:08 -08:00
Bryce Harrington
48bf640d16 configure.ac: re-bump version to 1.6.92 for rc1 release 2015-01-30 19:08:22 -08:00
Jon Cruz
23a57b69ff 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>
2015-01-30 18:58:08 -08:00
Bryce Harrington
768724495e configure.ac: bump version to 1.6.92 for rc1 release 2015-01-30 14:57:53 -08:00
Bryce Harrington
ccb17a05a3 gitignore: Add the new cpp-compile-test 2015-01-29 17:25:16 -08:00
Bill Spitzak
6be2d9aaef 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>
2015-01-29 17:13:01 -08:00
Andrew Oakley
a4afd90f9f 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).
2015-01-28 21:29:10 -08:00
Rui Matos
cd0cf5a106 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>
2015-01-28 18:44:46 -08:00
Derek Foreman
5ec8062df2 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>
2015-01-28 18:12:31 -08:00
Jon Cruz
7575e2ea19 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>
2015-01-28 17:43:19 -08:00
Jon Cruz
8cf9a367c9 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>
2015-01-28 17:43:18 -08:00
Jon Cruz
b5fca036cc 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>
2015-01-28 17:43:16 -08:00
Marek Chalupa
f858550cf4 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>
2015-01-28 17:17:24 +00:00
Marek Chalupa
68c11c48c0 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>
2015-01-28 17:17:22 +00:00
Marek Chalupa
5c70c03190 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>
2015-01-28 17:17:19 +00:00
Marek Chalupa
73cb90763c 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>
2015-01-28 17:17:16 +00:00
Marek Chalupa
2e20270280 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>
2015-01-28 17:17:13 +00:00
Marek Chalupa
d1855797d3 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>
2015-01-28 17:17:09 +00:00
Marek Chalupa
9ef0277571 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.]
2015-01-28 17:17:06 +00:00
Marek Chalupa
d8e72f98f2 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>
2015-01-28 17:15:57 +00:00
Mariusz Ceier
6197f32cad 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>
2015-01-27 11:18:36 +00:00
Mariusz Ceier
e3dc9a7af6 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>
2015-01-27 11:17:42 +00:00
Bryce Harrington
9386e2be27 tests: Correct return code handling
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
2015-01-26 18:11:40 -08:00
Bryce Harrington
2eeb2cbc52 tests: Fix typo "evnironment"
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Marek Chalupa <mchqwerty@gmail.com>
2015-01-26 18:11:11 -08:00
Bill Spitzak
284da98a3c 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>
2015-01-26 17:55:00 -08:00
Bill Spitzak
ed57d6d438 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>
2015-01-26 17:54:59 -08:00
Bill Spitzak
5409187ed0 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>
2015-01-26 17:54:54 -08:00
Bryce Harrington
71c37eb91a cosmetic: Cleanup trailing whitespace 2015-01-26 11:30:57 -08:00
Derek Foreman
a1a6aa54aa 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>
2015-01-26 11:29:03 -08:00
Bill Spitzak
6750538455 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>
2015-01-23 18:45:03 -08:00
Bill Spitzak
d90fd15ee4 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>
2015-01-23 18:45:02 -08:00
Bill Spitzak
be8064d2d4 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>
2015-01-23 18:45:01 -08:00
Bill Spitzak
1f39fbf8d2 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>
2015-01-23 18:44:57 -08:00
Bill Spitzak
d3770c0661 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>
2015-01-23 18:44:56 -08:00
Bill Spitzak
074e120cb3 doc: Remove deprecated functions from documentation
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-01-23 18:44:55 -08:00
Bill Spitzak
594ec7e689 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>
2015-01-23 18:44:54 -08:00
Jonas Ådahl
ab3ee6f6d9 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>
2015-01-23 18:20:41 -08:00
Jonas Ådahl
5ce947bd90 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>
2015-01-23 18:20:35 -08:00
Jonas Ådahl
434d797d27 protocol: Fix typo in wl_data_offer
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2015-01-23 18:20:29 -08:00
Bryce Harrington
b7f9925abc configure.ac: bump version to 1.6.91 for the alpha release 2015-01-17 03:39:05 -08:00
Bill Spitzak
2888e97d5d 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>
2014-12-19 16:33:34 +02:00
Bill Spitzak
0d0a62c79a 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>
2014-12-19 16:27:51 +02:00