| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
Print usage if we don't recognize the invocation mode. Also fixes
uninitialized variable warning.
|
| |
|
|
|
|
|
|
|
|
| |
In wl_display_dispatch_queue, if poll fails then it would previously
return immediately and leak a reference in display->reader_count. Then
if the application ignores the error and tries to read again it will
block forever. This can happen for example if the poll fails with
EINTR which the application might consider to be a recoverable error.
This patch makes it cancel the read so the reader_count will be
decremented when poll fails.
|
| |
|
|
| |
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
|
| |
|
|
|
| |
The errno is set to EAGAIN when there are undispatched events, according
to L1066 of wayland-client.c.
|
| |
|
|
|
| |
Prefer \comment over // in code blocks for consistency's sake and keep
variable definitions separated by a line from the rest of the body.
|
| | |
|
| |
|
|
|
| |
The old description was a bit vague; this commit hopefully improves
describing what is returned.
|
| |
|
|
|
|
| |
This is needed for doxygen to generate output for macro definitions, such
as wl_container_of, that are contained by this file. Classes like
wl_list would be documented regardless.
|
| |
|
|
| |
This commit adds a bit more detail on the lifecycle of a signal.
|
| |
|
|
|
| |
This patch takes Kristian's comments into account, adding a demonstration and
giving a more thorough idea of how wl_listener is used.
|
| |
|
|
|
| |
A version of wl_resource_for_each that is safe for iteration when items
in the list are removed.
|
| | |
|
| | |
|
| |
|
|
|
| |
This warning is unnecessary, since the pointer in question is only used
for pointer arithmetic, but setting it explicitly to NULL doesn't hurt.
|
| |
|
|
|
|
|
| |
If an interface has a destructor but no 'destroy' method we used to
not emit a destroy method. Now with the fix for missing destroy
requests for wl_pointer etc we need to emit the local wl_*_destroy
always.
|
| |
|
|
|
|
|
| |
This commit adds support for language bindings on the client half of the
library. The idea is the same as for server-side dispatchers.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds support for server-side languages bindings. This is done
in two ways:
1. Adding a wl_resource_set_dispatcher function that corresponds to
wl_resource_set_interface. The only difference between the two functions
is that the new version takes a dispatcher along with the implementation,
data, and destructor. This allows for runtime calling of native language
functions for callbacks instead of having to generate function pointers.
2. Adding versions of wl_resource_post_event and wl_resource_queue_event
that take an array of wl_argument instead of a variable argument list.
This allows for easier run-time argument conversion and removes the need
for libffi-based calling of variadic functions.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
|
| |
|
|
|
|
| |
This is the mirror function to wl_proxy_add_listener and is useful
inside client libraries to differentiate events on listeners for which
multiple proxies have been created.
|
| |
|
|
|
| |
This macro allows you to correctly iterate through a list of resources
handling the opaque nature of this type.
|
| |
|
|
| |
Signed-off-by: Bryce Harrington <b.harrington@samsung.com>
|
| | |
|
| |
|
|
| |
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
|
| |
|
|
|
|
|
|
|
| |
wayland-scanner without arguments prints out usage. With help or --help it
waits for stdin to supply something which isn't quite as informative as
printing out the help.
This patch also moves the strcmp for args up to have all of them in one
location.
|
| |
|
|
| |
We just declare struct wl_display manually instead.
|
| | |
|
| |
|
|
|
|
|
| |
We we're using wl_event_loop_add_idle() here, but if we're failing
because of OOM, that will typically also fail. Instead, use the
existing client->error flag, which will break out of the event
handling loop and shut down the client.
|
| |
|
|
|
| |
If we can't allocate a closure, don't just silently continue. Set
client->error so we shut down the client when we're done processing events.
|
| |
|
|
|
| |
We're supposed to return number of events dispatched on success, not 0.
Refactor to avoid goto and just return ret.
|
| |
|
|
|
| |
Instead, return -1 on out-of-memory. errno will be set to ENOMEM by
the failing malloc.
|
| |
|
|
|
| |
Failing with an error message and error code is little nicer. I doubt we'll
hit this case much, but it makes the static analysis happy.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Functions like wl_argument_from_va_list expect from get_next_argument,
to initialize details->type but when the signature is empty or contains
only version (like in desktop-shell-protocol.c in weston) it is left
uninitialized.
This patch fixes it, by initializing details->type with '\0' value,
signaling end of arguments.
Signed-off-by: Mariusz Ceier <mceier+wayland@gmail.com>
|
| | |
|
| |
|
|
|
|
|
| |
We can't do that there, we have to make sure it stays a valid fd until
the application calls wl_display_disconnect(). Otherwise the application
may end up poll()ing on a stale or wrong fd in case another part of the
application (or another thread) triggered a fatal error.
|
| |
|
|
|
|
|
|
|
| |
Getting no data from the socket is not an error condition. This may
happen in case of calling prepare_read() and then read_events() with
no other pending readers and no data in the socket. In general,
read_events() may not queue up events in the given event queue. From
a given threads point of view it doesn't matter whether events were
read and put in a different event queue or no events were read at all.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If EOF is encountered while reading from the Wayland socket, make
wl_display_read_events() return -1 so that it will be treated as an
error. The documentation for this function states that it will set
errno when there is an error so it additionally makes up an errno of
EPIPE.
If we don't do this then when the compositor quits the Wayland socket
will be become ready for reading but wl_display_dispatch will do
nothing which typically makes the application take up 100% CPU. In
particular eglSwapBuffers will likely get stuck in an infinite busy
loop because it repeatedly calls wl_display_dispatch_queue while it
waits for the frame callback.
https://bugzilla.gnome.org/show_bug.cgi?id=703892
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch introduces wl_global_create() and wl_global_destroy() as
replacements for wl_display_add_global() and wl_display_remove_global().
The add/remove_global API did not allow a compositor to indicate
the implemented version of a global, it just took the version from
the interface meta data. The problem is that the meta data
(which lives in libwayland-server.so) can get out of sync with a
compositor implementation. The compositor will then advertise a
higher version of a global than what it actually implements.
The new API lets a compositor pass in a version when it registers
a global, which solves the problem. The add/remove API is deprecated
with this patch and will be removed.
|
| |
|
|
|
| |
To allow user program to include wayland-scanner.m4 in tarball, move
the path variables from it into wayland-scanner.pc.
|
| |
|
|
| |
We need to free the non-legacy resources during client shutdown as well.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The wl_client_add/new_object() functions sends out an NO_MEMORY error if
the allocation fails. This was convenient in a couple of places where
that was all the error handling that was needed. Unfortunately that
looks like out-of-memory isn't handled at the call site and set a bad
precedent for not cleaning up properly or not handling at all.
As we're introducing wl_resource_create() as a replacement for those two
functions, let's remove the automatic error event posting and require
the caller to do that if necessary.
This commit also introduces a new helper, wl_client_post_no_memory() to
make it possible to send NO_MEMORY events from bind where we don't have
a wl_resource.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
This commit provides a layer of protection for the compositor in the form
of message version checking. We track version information in the
wl_resource and now use this version information to verify that a request
exists in that protocol version before invoking it. This way libwayland
won't accidentally invoke a request that does not exist and thereby cause
the compositor to crash.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
A new function, wl_resource_create(), lets the compositor create a
wl_resource for a given version of the interface. Passing 0 for the
object ID will allocate a new ID. The implementation, user data and
destructor can be set with wl_resource_set_implementation().
These two functions deprecates wl_client_add/new_object and the
main difference and motivation is the ability to provide a version number
for the resource. This lets the compositor track which version of the
interface a client has created and we'll use that to verify incoming requests.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This commit adds version information to wl_message signatures and a
wl_message_get_since function to retrieve. The since version comes in the
form of a (possible) integer at the begining of the message. If the
message starts with an integer, then it specifies the "since" version of
that message. Messages present in version one do not get this "since"
information. In this way we can run-time detect the version information
for a structure on a per-message basis.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
|
| |
|
|
|
|
|
|
|
|
| |
With the work to add wl_resource accessors and port weston to use them,
we're ready to make wl_resource and wl_object opaque structs. We keep
wl_buffer in the header for EGL stacks to use, but don't expose it by
default. In time we'll remove it completely, but for now it provides a
transition paths for code that still uses wl_buffer.
Reviewed-by: Jason Ekstrand<jason@jlekstrand.net>
|
| |
|
|
|
|
|
| |
This commit also has the effect of making wl_shm_buffer no longer a
wl_buffer derivative.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
|
| |
|
|
|
|
|
| |
This commit does not break ABI. It merely changes the types of some things
and adds a wl_shm_buffer_get function.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
|
| |
|
|
| |
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This commit makes wl_resource_destroy automatically free all non-legacy
resource structures. Since wl_resource is now an opaque structure it
doesn't make sense for the clients to be freeing it. This checks to make
sure that it was added through wl_client_add_object or wl_client_new_object
and not wl_client_add_resource before it frees it. This way if it is a
legacy resources embedded in a structure somewhere we don't have an invalid
free.
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
|