Commit graph

1097 commits

Author SHA1 Message Date
Kristian Høgsberg
f5ccd7a9e6 Bump version to 0.95.0 2012-07-24 15:45:00 -04:00
Kristian Høgsberg
6ebde80f0f Make distcheck work from builddir configured with --disable-documentation 2012-07-24 15:10:12 -04:00
Daniel Stone
3ec40512c7 More consistent ID printing
Use unsigned rather than signed for IDs, so they match up with what we
see in other prints.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-07-23 20:17:10 -04:00
Daniel Stone
db0add6d5e Make NEW_IDs nullable
The connection-handling code already allows this, so make it legal in
the protocol definition too.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-07-23 20:16:57 -04:00
Daniel Stone
efe23443d8 Unstatic arg_count_for_signature and get_next_argument
Expose these to other files using wayland-private.h, so wayland-client.c
can walk NULLables properly.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-07-23 20:15:28 -04:00
Kristian Høgsberg
a2c79b14a1 tests: Wrap calloc by just returning NULL if we're called too early
Since glibc dlsym() calls calloc, we get a call to our calloc wrapper as
we try to look up the real calloc implementation.  dlsym() will fall back
to a static buffer in case calloc returns NULL, so that's what we'll do.

This is all highly glibc dependent, of course, but the entire malloc
weak symbol wrapper mechanism is, so there's no loss of generality here.
2012-07-23 20:14:33 -04:00
Daniel Stone
61e9196f56 test-runner: Wrap realloc() too
So all our tests don't start failing just because we had the temerity to
use realloc() rather than malloc().

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-07-23 16:40:58 -04:00
Daniel Stone
16b4c87470 .gitignore: Add ctags and cscope files
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-07-23 16:40:38 -04:00
Kristian Høgsberg
eadb68ec32 protocol: Add transform argument to wl_output.geometry event 2012-07-22 15:50:37 -04:00
Mathias Fiedler
0b8b397e34 connection: reserve id on incoming new object
If a new object id arrives ensure that there is an empty array entry
created, otherwise we might get out of sync for new ids if object isn't
created by interface implementation.
2012-07-22 14:09:51 -04:00
Mathias Fiedler
bfcd681930 wayland-util: add method for reserving new object id
wl_map_reserve_new() ensures that new id is valid and will point to an
empty array entry.
2012-07-22 14:09:48 -04:00
Mathias Fiedler
900e4b63ef wayland-server: send error on invalid new object id
Creation of new client resources was silently ignored when
wl_client_add_resource() was used on server side and new object id was out
of range.

An error is now send out to the client in such case.

Also changed error message in wl_client_add_object, since
wl_map_insert_at() returns -1 only at invalid new id.
2012-07-22 14:06:37 -04:00
Kristian Høgsberg
76bfd68f47 wayland-shm: Commit the width/height getters that actually compile 2012-07-20 12:30:07 -04:00
Kristian Høgsberg
0b4ed5fe72 README: Update
The wayland README had outdated build instructions for weston.  Let's just
trim it down to build instructions for wayland and a link to the web site.
2012-07-20 12:20:20 -04:00
Kristian Høgsberg
7ba218c9f8 shm: Add shm_buffer getters for width and height 2012-07-20 12:04:42 -04:00
Robert Ancell
0a9cd16f6a wayland-client: Add missing newline from an error message 2012-07-20 12:04:05 -04:00
Dmitry Guryanov
2e79c4877f remove listener from wl_data_source destroy_signal listener list
I've found a bug during wayland exploration - if you make two
drag'n'drops in weston client example, dnd - weston crashes with
segfault. I've tried to investigate it and found a problem.

In function drag_grab_button we first call data_device_end_drag_grab,
which sets seat->drag_data_source to NULL. Then we remove
listener from list only if drag_data_source is not NULL.

So if client will not free wl_data_source and start another drag'n'drop,
after the first one. Then two wl_data_source structures will be
free'd on client exit (let's name them s1 and s2).

next and prev pointer of
wl_data_source.resource.destroy_signal.listener_list in both
wl_data_source structures will be seat->drag_data_source_listener,
but next and prev in seat->drag_data_source_listener.link point
to listener_list in s2.

So if you try to iterate over listener_list in s1
then you get drag_data_source_listener as first item and
(struct wl_listener *)(&s2.resource.destroy_signal.listener_list)

Iteration over that list occurs in
wl_resource_destroy->destroy_resource->wl_signal_emit->wl_signal_emit
and try to call function at address of wl_resource->client, so
weston segfaults there.
2012-07-17 16:54:07 -04:00
Pekka Paalanen
52e6dc71be cursor: fix fd leak and a segfault
- don't leak fd in shm_pool_destroy()
- return NULL from wl_cursor_theme_load() if pool fails

Tha last one fixes a segfault, when shm_pool_create() has failed.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-07-10 14:11:00 -04:00
Pekka Paalanen
a88a4386cb cursor: use os_create_anonymous_file()
Copy the implementation of os_create_anonymous_file() here from weston,
so we can use it instead of hardcoding a path to /tmp.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-07-10 14:08:59 -04:00
Pekka Paalanen
9326498d03 server: fix wl_seat_set_keyboard
This makes wl_seat_set_keyboard similar to wl_seat_set_pointer in that
it's a no-op, if you try to set keyboard to NULL when it already is
NULL, instead of refusing to set it to NULL ever.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-07-10 14:08:01 -04:00
Pekka Paalanen
23bf48063f server: add lose_touch_focus()
Just like wl_keyboard and wl_pointer, add a signal handler for losing
touch focus.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-07-10 13:57:33 -04:00
Robert Ancell
e7e1296682 scanner: Include weston-client.h as the inline functions require it 2012-07-09 22:01:25 -04:00
Kristian Høgsberg
b4aff6b79f wayland-shm: Add return before we hit the error clean-up path
Regression in c94c0946db
2012-07-09 21:50:39 -04:00
Martin Olsson
dba322c1c0 Fixup source comment in wayland-util.h and fix typo in TODO 2012-07-09 18:11:06 -04:00
Martin Olsson
fc0c2e04c5 doc: fix some typos in documentation 2012-07-09 18:03:56 -04:00
Ander Conselvan de Oliveira
84bac043e1 protocol: Add missing allow-null to data_device.enter data_offer field
Fixes bug 51889.
2012-07-09 18:00:31 -04:00
Martin Olsson
c94c0946db shm: Plug leak in shm_create_pool() 2012-07-09 17:59:45 -04:00
Martin Olsson
53bb401704 server: Don't crash for wl_seat_set_touch(seat, NULL) 2012-07-09 17:59:36 -04:00
Martin Olsson
e760ec9fa9 scanner: Plug memory leak in end_element() 2012-07-09 17:59:23 -04:00
Martin Olsson
00902b3815 wayland-cursor: Add error handling for shm_pool_create() 2012-07-09 17:59:08 -04:00
Kristian Høgsberg
8a023688c0 protocol: Add a couple of missing allow-null annotations
wl_data_device.set_selection() allows NULL to withdraw the previously set
selection and wl_surface.attach() allows a NULL buffer to hide the surface.
2012-07-02 14:34:48 -04:00
Christopher James Halse Rogers
11db60fe72 protocol: Explicitly mark requests which allow null arguments
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-07-02 13:53:06 -04:00
Christopher James Halse Rogers
161c690b55 protocol: Add explicit nullable types
Most of the time it does not make sense to pass a NULL object, string, or array
to a protocol request. This commit adds an explicit “allow-null” attribute
to mark the request arguments where NULL makes sense.

Passing a NULL object, string, or array to a protocol request which is not
marked as allow-null is now an error. An implementation will never receive
a NULL value for these arguments from a client.

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
2012-07-02 13:53:02 -04:00
Dylan Noblesmith
d2bcffc470 tests: test that path names longer than 108 bytes are rejected
These would either overflow the struct sockaddr_un, or
be truncated and leave a non-null-terminated string.
2012-06-30 20:01:20 +00:00
Dylan Noblesmith
b486e3aba5 tests: fix make check for out-of-tree builds
It was failing with missing include files.

While here, destroy the ugly "../src/..." include
paths used in the tests that was just hacking around
this problem in the Makefile:

sed -i s/..\\/src\\/// tests/*.c
2012-06-30 19:58:37 +00:00
Dylan Noblesmith
c394b75958 tests: sort list of tests 2012-06-30 19:58:37 +00:00
Dylan Noblesmith
af5f8cc200 wayland-client: reject socket paths longer than 108 bytes
Attempting to write anything longer into the embedded char
array would create a non-null-terminated string, and all
later reads would run off the end into invalid memory.

This is a hard limitation of AF_LOCAL/AF_UNIX sockets.
2012-06-30 19:58:36 +00:00
Dylan Noblesmith
00c25a0565 wayland-server: reject socket paths longer than 108 bytes
Attempting to write anything longer into the embedded char
array would create a non-null-terminated string, and all
later reads would run off the end into invalid memory.

This is a hard limitation of AF_LOCAL/AF_UNIX sockets.
2012-06-30 19:58:05 +00:00
Dylan Noblesmith
4522467268 wayland-server: add more logging of errors 2012-06-30 19:57:22 +00:00
Dylan Noblesmith
30ff420ca9 wayland-server: fix socket ownership race condition
Always unlink() the lock file before closing the file
descriptor for it. Otherwise, there is a race like this:

Process A closes fd, releasing the lock
Process B opens the same file, taking the lock
Process A unlinks the lock file
Process C opens the same file, which now no longer exists,
and takes the lock on the newly created lock file

Process B and C both 'own' the same display socket.

unlink()ing while holding the lock is effectively a better
way to release the lock atomically.
2012-06-30 19:50:09 +00:00
Dylan Noblesmith
9475257459 wayland-server: fix fd leak on error path
And restructure get_socket_lock() so it's clearer that it's
allocating a new file descriptor.

Uncovered by an upcoming test.
2012-06-30 19:37:42 +00:00
Dylan Noblesmith
cadd999292 drop use of strerror()
It isn't thread-safe. Use the %m conversion specifier instead,
like the rest of the code already does.
2012-06-30 19:37:04 +00:00
Dylan Noblesmith
bb6e48b1b0 wayland-server: reduce use of magic numbers
Make it clear what the significance of '5' and '113' actually is.
Also drop an unneeded function argument.
2012-06-30 19:37:04 +00:00
Kristian Høgsberg
9de9e39f87 Allocate client proxy automatically for new objects
When the server send a new object ID, the client used to have to allocate
the proxy manually and without type-safety.  We now allocate the proxy
in a client-side post-processing step on the incoming closure.
2012-06-28 22:01:58 -04:00
Ander Conselvan de Oliveira
c30ad0d9da protocol: Change wording of pointer.set_cursor()
Change the description of pointer.set_cursor() so that a client without
pointer focus but that currently owns the pointer surface can update the
hotspot using it.
2012-06-28 14:13:41 -04:00
Kristian Høgsberg
ae6f3001a5 wl_shell: Don't require that parent surfaces are wl_shell_surfaces
The set_transient and set_popup requests take a wl_shell_surface as
the parent surface argument.  We don't need the parent surface to be
a shell surface and this restricts the types of surfaces we can use
the transient and popup surface types on.
2012-06-27 10:30:08 -04:00
Kristian Høgsberg
7e71c38b98 configure.ac: Bump version to 0.94.90 2012-06-25 18:09:00 -04:00
Kristian Høgsberg
9afb5f61f8 Send modifier event to pointer focus when it changes too 2012-06-22 14:38:12 -04:00
Kristian Høgsberg
67e16be8aa Send keyboard modifier event using the keyboard resource 2012-06-22 12:20:00 -04:00
Daniel Stone
bcefacb89d Maintain keyboard modifier state in wayland-server
Provide a slot for keyboard modifier state inside wl_keyboard for
implementations to update, and use this to send wl_keyboard:;modifier
events whenever the keyboard or pointer focus changes.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-22 11:06:44 -04:00