summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2013-02-04connection.c: Align pointer extra storage correctlyKristian Høgsberg1-4/+18
Most extra data are just pointers, but in case of fds we store an int in the extra space. That can cause un-aligned access to pointers on 64 bit architectures. Make sure we always align pointer storage correctly.
2013-01-28Match libtool version info in 1.0 branchKristian Høgsberg1-0/+1
Master should always as old or older than the stable branch. I didn't copy over the libtool version bump when we bumped it in the 1.0 branch.
2013-01-24event-loop: fix returning the destroy-signal listenerDavid Herrmann1-1/+1
We need to actually return the destroy-listener, otherwise the return value is undefined. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2013-01-15Add a destroy signal to the wl_event_loop objectJason Ekstrand2-0/+27
2013-01-11Added a destroy signal to the wl_display object.Jason Ekstrand2-0/+25
Added a destroy signal to the wl_display object.
2012-12-12client: remove two unused function pointer typedefsPekka Paalanen1-3/+0
The need for wl_display_update_func_t was removed in commit 53d24713a31d59d9534c1c1a84a7ad46f44ee95f Author: Kristian Høgsberg <krh@bitplanet.net> Date: Thu Oct 4 16:54:22 2012 -0400 Change filedescriptor API to be thread safe and wl_callback_func_t does not seem to have ever been used in the first place. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-11-30client: Add \since tag for wl_display_dispatch_queue_pending() documentationKristian Høgsberg1-0/+1
2012-11-27pkgconfig: Use configure provided directoriesQuentin Glidic2-8/+8
https://bugs.freedesktop.org/show_bug.cgi?id=57630
2012-11-27scanner: Fix wrong restriction on since fieldAnder Conselvan de Oliveira1-1/+1
The scanner would not allow two consecutive requests on an interface to have the same since number, so if a new version of an interface added two new request the version number would have to be increased by two.
2012-11-27client: Don't cancel a roundtrip when any event is receivedJonas Ådahl1-1/+4
Since wl_display_dispatch() returns the number of processed events or -1 on error, only cancel the roundtrip if an -1 is returned. This also fixes a potential memory corruption bug happening when wl_display_roundtrip() does an early return and the callback later writes to the then out of scope stack allocated `done' parameter. Introduced by 33b7637b4500a682018b503837b8aca9afae36f2. Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-11-23doc: Fix typosTiago Vignatti1-2/+2
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-11-23client: Add an entry point for dispatching a queue without blockingAnder Conselvan de Oliveira2-0/+21
On the client side EGL, all the wl_buffer.release events need to be processed before buffer allocation, otherwise a third buffer might be allocated unnecessarily. However, the buffer allocation should not block in the case no event was received. In order to do that, a non-blocking queue dispatch function is needed.
2012-11-21debug: Allow WAYLAND_DEBUG=server/client for server/client side only debugKristian Høgsberg2-2/+2
By default the server will dump protocol for both the server and its clients when run with WAYLAND_DEBUG=1. That's still the case, but it now also understands WAYLAND_DEBUG=client or WAYLAND_DEBUG=server, which will only enable debug dumping on either client or server side.
2012-11-14client: Fix source comment typosMartin Olsson1-3/+3
2012-11-05client: Keep track of proxy validity and number of reference holdersJonas Ådahl2-20/+110
When events are queued, the associated proxy objects (target proxy and potentially closure argument proxies) are verified being valid. However, as any event may destroy some proxy object, validity needs to be verified again before dispatching. Before this change this was done by again looking up the object via the display object map, but that did not work because a delete_id event could be dispatched out-of-order if it was queued in another queue, causing the object map to either have a new proxy object with the same id or none at all, had it been destroyed in an earlier event in the queue. Instead, make wl_proxy reference counted and increase the reference counter of every object associated with an event when it is queued. In wl_proxy_destroy() set a flag saying the proxy has been destroyed by the application and only free the proxy if the reference counter reaches zero after decreasing it. Before dispatching, verify that a proxy object still is valid by checking that the flag set in wl_proxy_destroy() has not been set. When dequeuing the event, all associated proxy objects are dereferenced and free:ed if the reference counter reaches zero. As proxy reference counter is initiated to 1, when dispatching an event it can never reach zero without having the destroyed flag set. Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-10-21scanner: Preserve paragraph breaks in input XMLKristian Høgsberg1-3/+9
If we have a blank line in the incoming XML documentation, keep that in the emitted doxygen comments.
2012-10-20scanner: Fix valgrind errorsKristian Høgsberg1-8/+7
2012-10-19Rename __wl_container_of macro to just wl_container_ofKristian Høgsberg1-12/+12
The _* namespace and identifiers with double underscore are reserved by the C standard. That makes __wl_container_of is double plus bad, so lets just call it wl_container_of.
2012-10-19Move un-namespaced container_of into private headerKristian Høgsberg4-4/+6
2012-10-19Move ARRAY_LENGTH out of public headersKristian Høgsberg4-6/+19
Exporting unprefixed symbols is a pretty bad idea so don't do that. Instea of redefining it WL_ARRAY_LENGTH, we just move the define to our private header. The scanner generates code that uses ARRAY_LENGTH, but we can just make it count the number elements and emit an integer constant instead.
2012-10-19doc: Clarify documentation about dispatching event queuesAnder Conselvan de Oliveira2-14/+96
Clarify on what cases each of the dispatching functions may block, what is the main thread and add some real world examples.
2012-10-17doc: Update wl_display_get_error() documentationAnder Conselvan de Oliveira1-2/+8
2012-10-17wayland-server: Fix up error handling with client creation.John Kåre Alsaker1-15/+26
2012-10-16wayland-egl: Drop ill-defined pixmap supportKristian Høgsberg1-9/+0
We don't have a use case for this and the actual semantics and synchronization behavior of wl_egl_pixmap were never really well-defined. It also doesn't provide the cross-process buffer sharing that make window systems pixmaps useful in other window systems.
2012-10-16connection: Dereference id completely for comparasion.John Kåre Alsaker1-2/+2
2012-10-16connection: Removed crashing code.John Kåre Alsaker1-2/+0
2012-10-16scanner: Make sure arguments have names.John Kåre Alsaker1-0/+3
2012-10-16connection: Don't call memcpy with null pointer.John Kåre Alsaker1-3/+3
2012-10-16doc: Add doxygen documentation to wl_display_get_error()Ander Conselvan de Oliveira1-0/+7
2012-10-16doc: Document change of return value of dispatch functionsAnder Conselvan de Oliveira1-2/+3
2012-10-16doc: Document the restriction of destroying queues before the displayAnder Conselvan de Oliveira1-0/+4
2012-10-16doc: Put wl_display_flush() documentation in the right placeAnder Conselvan de Oliveira1-12/+12
It seems a rebase error caused it to end up in the wrong place.
2012-10-15wayland-server: Add touch grab supportMatt Roper2-0/+101
Touch grabs allow the compositor to be placed into a mode where touch events temporarily bypass their default behavior and perform other operations. Wayland already supports keyboard and pointer grabs, but was lacking corresponding touch support. The default touch grab handlers here contain the client event delivery code that was previously called directly in weston. Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2012-10-15wayland-client: forward fatal errors to callerDavid Herrmann2-20/+81
If any callback or helper function fails with a fatal error, we now set the last_error flag and prevent all further I/O on the wl_display. We wake up all sleeping event-queues and notify the caller that they should shutdown wl_display. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15wayland: Take ownership of fd in wl_display_connect_to_fd()Kristian Høgsberg1-11/+9
This means we're free to close it when we want, which we'll use to wake up the main thread if we hit an error in a different thread.
2012-10-15wayland-client: link all event-queues of each display into a listDavid Herrmann1-3/+17
We need access to all event-queues of a single wl_display object. For instance during connection-errors, we need to be able to wake up all event queues. Otherwise, they will be stuck waiting for incoming events. The API user is responsible to keep a wl_display object around until all event-queues that were created on it are destroyed. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15connection: return error on buffer-overflow during readKristian Høgsberg1-0/+5
wl_connection_read() assumes that the caller dispatched all messages before calling it. wl_buffer_put_iov() does only provide enough room so we fill the buffer. So the only case when the buffer overflows, is when a previous read filled up the buffer but we couldn't parse a single message from it. In this case, the client sent a message bigger than our buffer and we should return an error and close the connection. krh: Edited from Davids original patch to just check that the buffer isn't full before we try reading into it. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15connection: Use uin32_t for circular buffer indexesKristian Høgsberg1-6/+6
We rely on well-defined unsigned overflow behaviour so let's make the index fields actually unsigned. Signed ints aren't guaranteed to have the behavior we want (could be either ones or twos complement).
2012-10-15connection: fix leaking FDs on buffer-overflow during readDavid Herrmann1-7/+26
If we read more FDs than we have room for, we currently leak FDs because we overwrite previous still pending FDs. Instead, we do now close incoming FDs if the buffer is full and return EOVERFLOW. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15connection: fix buffer-overflow in build_cmsg()David Herrmann1-0/+3
Same problem as we had with close_fds(). We cannot rely on the fds_out buffer being filled with less than MAX_FDS_OUT file descriptors. Therefore, write at most MAX_FDS_OUT file-descriptors to the outgoing buffer. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15connection: close pending incoming FDs on shutdownDavid Herrmann1-0/+1
Same problem as with outgoing FDs. We need to close these on shutdown, otherwise we leak open file descriptors. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15connection: fix buffer-overflow in close_fds()David Herrmann1-4/+6
If we push two messages via wl_connection_write() and both messages contain more than MAX_FDS_OUT file-descriptors combined, then wl_connection_flush() will write only MAX_FDS_OUT of them, but close all pending ones, too. Furthermore, close_fds() will copy more FDs out of the buffer than it can hold and cause a buffer overflow. Therefore, we simply pass a maximum limit to close_fds(). During shutdown, we simply close all available FDs. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15connection: close pending outgoing fds on shutdownDavid Herrmann1-17/+18
When destroying a wl_connection object, there might still be data in the queue. We would leak open file-descriptors so we must close them. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15wayland-util: return 0 on OOM in wl_map_insert_new()David Herrmann1-0/+2
If we cannot increase the array for new entries, we now return 0 instead of accessing invalid memory. krh: Edited to return 0 on failure instead. In the initialization path, we call wl_map_insert_new() to insert NULL at index 0, which also returns 0 but not as an error. Since we do that up front, every other case of returning 0 is an unambiguous error. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15wayland-util: return -1 if wl_array_copy() failsDavid Herrmann2-4/+10
We might have to perform memory allocations in wl_array_copy(), so catch out-of-memory errors in wl_array_add() and return -1 before changing any state. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15wayland-client: add wl_display_get_error()David Herrmann2-3/+37
A server may asynchronously send errors via wl_display.error() events. Instead of aborting we now the a "last_error" flag inside of wl_display objects. The user can retrieve these via wl_display_get_error(). Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
2012-10-15doc: Improve libwayland-client doxygen documentationAnder Conselvan de Oliveira2-7/+94
Document wl_proxy, wl_display and wl_event_queue classes and add a description to all public entry points. Also fix some typos.
2012-10-15doc: Add some doxygen documentation to wayland-client entry pointsAnder Conselvan de Oliveira2-1/+178
Add some brief documentation for the public libwayland-client entry points. This is by no means complete, some functions are still undocumented and some might need extra information. Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-10-15scanner: use printf format attributes for desc_dumpOlivier Blin1-0/+3
2012-10-15scanner: fix writing i586 descriptionsOlivier Blin1-18/+19
This moves desc as first argument of desc_dump(). Description writing was broken on i586 because desc_dump() used va_arg() after a vsnprintf() call to find the last argument. But after calling a function with a va_arg argument, this arguments is undefined.