profile/ivi/wayland.git
11 years agoMake NEW_IDs nullable
Daniel Stone [Mon, 23 Jul 2012 18:54:41 +0000 (19:54 +0100)]
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>
11 years agoUnstatic arg_count_for_signature and get_next_argument
Daniel Stone [Mon, 23 Jul 2012 18:54:40 +0000 (19:54 +0100)]
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>
11 years agotests: Wrap calloc by just returning NULL if we're called too early
Kristian Høgsberg [Tue, 24 Jul 2012 00:14:33 +0000 (20:14 -0400)]
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.

11 years agotest-runner: Wrap realloc() too
Daniel Stone [Mon, 23 Jul 2012 18:54:39 +0000 (19:54 +0100)]
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>
11 years ago.gitignore: Add ctags and cscope files
Daniel Stone [Mon, 23 Jul 2012 18:54:38 +0000 (19:54 +0100)]
.gitignore: Add ctags and cscope files

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
11 years agoprotocol: Add transform argument to wl_output.geometry event
Kristian Høgsberg [Sun, 22 Jul 2012 19:46:16 +0000 (15:46 -0400)]
protocol: Add transform argument to wl_output.geometry event

11 years agoconnection: reserve id on incoming new object
Mathias Fiedler [Wed, 18 Jul 2012 13:53:23 +0000 (15:53 +0200)]
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.

11 years agowayland-util: add method for reserving new object id
Mathias Fiedler [Wed, 18 Jul 2012 13:52:51 +0000 (15:52 +0200)]
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.

11 years agowayland-server: send error on invalid new object id
Mathias Fiedler [Wed, 18 Jul 2012 13:51:45 +0000 (15:51 +0200)]
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.

11 years agowayland-shm: Commit the width/height getters that actually compile
Kristian Høgsberg [Fri, 20 Jul 2012 16:30:07 +0000 (12:30 -0400)]
wayland-shm: Commit the width/height getters that actually compile

11 years agoREADME: Update
Kristian Høgsberg [Fri, 20 Jul 2012 16:20:15 +0000 (12:20 -0400)]
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.

11 years agoshm: Add shm_buffer getters for width and height
Kristian Høgsberg [Fri, 20 Jul 2012 16:04:42 +0000 (12:04 -0400)]
shm: Add shm_buffer getters for width and height

11 years agowayland-client: Add missing newline from an error message
Robert Ancell [Tue, 10 Jul 2012 03:52:12 +0000 (15:52 +1200)]
wayland-client: Add missing newline from an error message

11 years agoremove listener from wl_data_source destroy_signal listener list
Dmitry Guryanov [Tue, 17 Jul 2012 14:56:03 +0000 (18:56 +0400)]
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.

12 years agocursor: fix fd leak and a segfault
Pekka Paalanen [Tue, 10 Jul 2012 10:05:03 +0000 (13:05 +0300)]
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>
12 years agocursor: use os_create_anonymous_file()
Pekka Paalanen [Tue, 10 Jul 2012 10:05:02 +0000 (13:05 +0300)]
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>
12 years agoserver: fix wl_seat_set_keyboard
Pekka Paalanen [Tue, 10 Jul 2012 10:05:01 +0000 (13:05 +0300)]
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>
12 years agoserver: add lose_touch_focus()
Pekka Paalanen [Tue, 10 Jul 2012 10:05:00 +0000 (13:05 +0300)]
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>
12 years agoscanner: Include weston-client.h as the inline functions require it
Robert Ancell [Thu, 5 Jul 2012 04:31:29 +0000 (16:31 +1200)]
scanner: Include weston-client.h as the inline functions require it

12 years agowayland-shm: Add return before we hit the error clean-up path
Kristian Høgsberg [Tue, 10 Jul 2012 01:50:39 +0000 (21:50 -0400)]
wayland-shm: Add return before we hit the error clean-up path

Regression in c94c0946db694ec29b5aebb94a8be0501bacfbc7

12 years agoFixup source comment in wayland-util.h and fix typo in TODO
Martin Olsson [Mon, 9 Jul 2012 16:22:05 +0000 (18:22 +0200)]
Fixup source comment in wayland-util.h and fix typo in TODO

12 years agodoc: fix some typos in documentation
Martin Olsson [Mon, 9 Jul 2012 13:50:39 +0000 (15:50 +0200)]
doc: fix some typos in documentation

12 years agoprotocol: Add missing allow-null to data_device.enter data_offer field
Ander Conselvan de Oliveira [Mon, 9 Jul 2012 10:15:20 +0000 (13:15 +0300)]
protocol: Add missing allow-null to data_device.enter data_offer field

Fixes bug 51889.

12 years agoshm: Plug leak in shm_create_pool()
Martin Olsson [Mon, 9 Jul 2012 09:35:57 +0000 (11:35 +0200)]
shm: Plug leak in shm_create_pool()

12 years agoserver: Don't crash for wl_seat_set_touch(seat, NULL)
Martin Olsson [Mon, 9 Jul 2012 09:35:56 +0000 (11:35 +0200)]
server: Don't crash for wl_seat_set_touch(seat, NULL)

12 years agoscanner: Plug memory leak in end_element()
Martin Olsson [Mon, 9 Jul 2012 09:35:55 +0000 (11:35 +0200)]
scanner: Plug memory leak in end_element()

12 years agowayland-cursor: Add error handling for shm_pool_create()
Martin Olsson [Mon, 9 Jul 2012 09:35:54 +0000 (11:35 +0200)]
wayland-cursor: Add error handling for shm_pool_create()

12 years agoprotocol: Add a couple of missing allow-null annotations
Kristian Høgsberg [Mon, 2 Jul 2012 18:34:48 +0000 (14:34 -0400)]
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.

12 years agoprotocol: Explicitly mark requests which allow null arguments
Christopher James Halse Rogers [Mon, 2 Jul 2012 10:03:31 +0000 (20:03 +1000)]
protocol: Explicitly mark requests which allow null arguments

Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
12 years agoprotocol: Add explicit nullable types
Christopher James Halse Rogers [Mon, 2 Jul 2012 10:03:30 +0000 (20:03 +1000)]
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>
12 years agotests: test that path names longer than 108 bytes are rejected
Dylan Noblesmith [Fri, 15 Jun 2012 22:56:37 +0000 (22:56 +0000)]
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.

12 years agotests: fix make check for out-of-tree builds
Dylan Noblesmith [Fri, 15 Jun 2012 22:44:28 +0000 (22:44 +0000)]
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

12 years agotests: sort list of tests
Dylan Noblesmith [Fri, 15 Jun 2012 22:06:58 +0000 (22:06 +0000)]
tests: sort list of tests

12 years agowayland-client: reject socket paths longer than 108 bytes
Dylan Noblesmith [Fri, 15 Jun 2012 21:39:50 +0000 (21:39 +0000)]
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.

12 years agowayland-server: reject socket paths longer than 108 bytes
Dylan Noblesmith [Fri, 15 Jun 2012 21:32:19 +0000 (21:32 +0000)]
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.

12 years agowayland-server: add more logging of errors
Dylan Noblesmith [Sat, 16 Jun 2012 22:51:35 +0000 (22:51 +0000)]
wayland-server: add more logging of errors

12 years agowayland-server: fix socket ownership race condition
Dylan Noblesmith [Sat, 30 Jun 2012 19:50:09 +0000 (19:50 +0000)]
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.

12 years agowayland-server: fix fd leak on error path
Dylan Noblesmith [Sat, 16 Jun 2012 22:47:42 +0000 (22:47 +0000)]
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.

12 years agodrop use of strerror()
Dylan Noblesmith [Fri, 15 Jun 2012 22:01:06 +0000 (22:01 +0000)]
drop use of strerror()

It isn't thread-safe. Use the %m conversion specifier instead,
like the rest of the code already does.

12 years agowayland-server: reduce use of magic numbers
Dylan Noblesmith [Fri, 15 Jun 2012 21:09:00 +0000 (21:09 +0000)]
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.

12 years agoAllocate client proxy automatically for new objects
Kristian Høgsberg [Fri, 29 Jun 2012 02:01:58 +0000 (22:01 -0400)]
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.

12 years agoprotocol: Change wording of pointer.set_cursor()
Ander Conselvan de Oliveira [Thu, 28 Jun 2012 15:08:03 +0000 (18:08 +0300)]
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.

12 years agowl_shell: Don't require that parent surfaces are wl_shell_surfaces
Kristian Høgsberg [Wed, 27 Jun 2012 14:30:08 +0000 (10:30 -0400)]
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.

12 years agoconfigure.ac: Bump version to 0.94.90 0.94.90
Kristian Høgsberg [Mon, 25 Jun 2012 22:09:00 +0000 (18:09 -0400)]
configure.ac: Bump version to 0.94.90

12 years agoSend modifier event to pointer focus when it changes too
Kristian Høgsberg [Fri, 22 Jun 2012 18:38:12 +0000 (14:38 -0400)]
Send modifier event to pointer focus when it changes too

12 years agoSend keyboard modifier event using the keyboard resource
Kristian Høgsberg [Fri, 22 Jun 2012 16:20:00 +0000 (12:20 -0400)]
Send keyboard modifier event using the keyboard resource

12 years agoMaintain keyboard modifier state in wayland-server
Daniel Stone [Fri, 22 Jun 2012 12:21:26 +0000 (13:21 +0100)]
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>
12 years agowayland-cursor: Plug leak of filename on load_all_cursors_from_dir()
Ander Conselvan de Oliveira [Tue, 19 Jun 2012 10:45:39 +0000 (13:45 +0300)]
wayland-cursor: Plug leak of filename on load_all_cursors_from_dir()

12 years agoXcursor: Don't ignore unknown file types
Daniel Stone [Mon, 18 Jun 2012 19:01:05 +0000 (20:01 +0100)]
Xcursor: Don't ignore unknown file types

XFS doesn't return the file type with opendir(), and instead only
returns it when you stat() the file itself.  c66f2602 introduced a check
to ensure that only files and symlinks were loaded, while not checking
for DT_UNKNOWN.  Properly handle DT_UNKNOWN by just proceeding anyway.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agodata-device: Fix list corruption when the source goes away
Kristian Høgsberg [Mon, 18 Jun 2012 16:09:47 +0000 (12:09 -0400)]
data-device: Fix list corruption when the source goes away

If the data source is destroyed, the corresponding offers may stay around for
a little longer (until the owning client destroys it).  When the offer is
finally destroyed, we have to be careful to only remove the source
destroy listener if the source hasn't yet been destroyed.

Thanks to Martin Minarik for tracking down where the corruption happened.

12 years agotests: Update test cases to new closure allocate convention
Kristian Høgsberg [Fri, 15 Jun 2012 20:09:39 +0000 (16:09 -0400)]
tests: Update test cases to new closure allocate convention

12 years agoTODO: Remove cursor-as-regular-surface item
Kristian Høgsberg [Fri, 15 Jun 2012 15:09:36 +0000 (11:09 -0400)]
TODO: Remove cursor-as-regular-surface item

12 years agocursor: Add function for calculating current frame in cursor animation
Ander Conselvan de Oliveira [Fri, 15 Jun 2012 14:27:33 +0000 (17:27 +0300)]
cursor: Add function for calculating current frame in cursor animation

Given a pointer to struct wl_cursor and an elapsed time in ms.,
wl_cursor_frame() will return the index of the cursor image the should
be displayed.

12 years agoprotocol: replace pointer.attach with pointer.set_cursor
Ander Conselvan de Oliveira [Fri, 15 Jun 2012 14:27:32 +0000 (17:27 +0300)]
protocol: replace pointer.attach with pointer.set_cursor

12 years agoTODO: Update to account for changes from Daniel
Kristian Høgsberg [Wed, 13 Jun 2012 17:33:01 +0000 (13:33 -0400)]
TODO: Update to account for changes from Daniel

12 years agoconnection: Set closure->start in demarshal too
Kristian Høgsberg [Tue, 12 Jun 2012 21:48:19 +0000 (17:48 -0400)]
connection: Set closure->start in demarshal too

12 years agoconnection: Always malloc closure
Kristian Høgsberg [Tue, 12 Jun 2012 21:45:25 +0000 (17:45 -0400)]
connection: Always malloc closure

This lets us allocate the closure just big enough and is a first step towards
a message queue.

12 years agowayland-server: Add destroy signal to wl_seat
Jonas Ådahl [Tue, 12 Jun 2012 21:57:33 +0000 (23:57 +0200)]
wayland-server: Add destroy signal to wl_seat

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
12 years agowayland-util: wl_list_insert_list() should accept empty lists
Jonas Ådahl [Tue, 12 Jun 2012 21:57:32 +0000 (23:57 +0200)]
wayland-util: wl_list_insert_list() should accept empty lists

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
12 years agowayland-cursor: add an option that changes the cursor theme directory
Ander Conselvan de Oliveira [Fri, 8 Jun 2012 08:58:02 +0000 (11:58 +0300)]
wayland-cursor: add an option that changes the cursor theme directory

Some distros (e.g. gentoo) install cursor themes in non-standard
directories. Add option --with-icondir to configure.sh that sets the
directory in which to look for cursors.

12 years agoserver: require XDG_RUNTIME_DIR
Pekka Paalanen [Wed, 6 Jun 2012 11:30:19 +0000 (14:30 +0300)]
server: require XDG_RUNTIME_DIR

An arbitrary fallback to the current directory is only confusing.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoclient: require XDG_RUNTIME_DIR
Pekka Paalanen [Wed, 6 Jun 2012 11:30:18 +0000 (14:30 +0300)]
client: require XDG_RUNTIME_DIR

An arbitrary fallback to the current directory is only confusing.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoAdd a focus change signal for wl_pointer and wl_keyboard
Kristian Høgsberg [Tue, 5 Jun 2012 13:56:42 +0000 (09:56 -0400)]
Add a focus change signal for wl_pointer and wl_keyboard

12 years agoTODO: Drop clipboard manager item
Kristian Høgsberg [Mon, 4 Jun 2012 03:11:34 +0000 (23:11 -0400)]
TODO: Drop clipboard manager item

We have a reasonable prototype in weston now and we're going to
conclude that the persistent selection functionality is either
going to be part of the compositor (as for weston) or use a custom
protocol.

12 years agodata-device: Don't implement data source through data offer object
Kristian Høgsberg [Sun, 3 Jun 2012 21:30:12 +0000 (17:30 -0400)]
data-device: Don't implement data source through data offer object

The wl_data_source object used to specify the implementation for data
offers created for it.  This means you need a data offer to retrieve the
data from the source, which makes it awkward to use in-process in a
compositor.  Now we instead have three virtual functions that can be
connected to a protocol object or in-process data-sources such as an
X server proxy or clipboard.

12 years agoAdd wl_keyboard::keymap event
Daniel Stone [Fri, 1 Jun 2012 11:13:37 +0000 (12:13 +0100)]
Add wl_keyboard::keymap event

With this event, the compositor generates one canonical keymap for all
clients, and then sends an mmap()able fd over the wire, rather than all
the clients generating possibly disparate keymaps.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agodata-device: Handle setting a NULL selection source
Kristian Høgsberg [Fri, 1 Jun 2012 03:29:08 +0000 (23:29 -0400)]
data-device: Handle setting a NULL selection source

12 years agodata-device: Emit selection_signal also when we lose the selection
Kristian Høgsberg [Fri, 1 Jun 2012 03:28:31 +0000 (23:28 -0400)]
data-device: Emit selection_signal also when we lose the selection

12 years agodata-device: Only send out NULL selection if we have a resource
Kristian Høgsberg [Fri, 1 Jun 2012 03:26:50 +0000 (23:26 -0400)]
data-device: Only send out NULL selection if we have a resource

If the current keyboard focus client doesn't have a resource for the
data_device, don't send out the selection event.

12 years agoConvert wl_pointer::axis to fixed
Daniel Stone [Wed, 30 May 2012 15:31:49 +0000 (16:31 +0100)]
Convert wl_pointer::axis to fixed

Which allows for smooth scrolling, among other things.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agoAdd key_state and button_state enums
Daniel Stone [Wed, 30 May 2012 15:31:48 +0000 (16:31 +0100)]
Add key_state and button_state enums

Rather than hardcoding 0 and 1 everywhere.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agowl_keyboard: Add modifier event
Daniel Stone [Wed, 30 May 2012 15:31:47 +0000 (16:31 +0100)]
wl_keyboard: Add modifier event

This event sends the current keyboard modifier/group state from the
compositor to the client, allowing all clients to have a consistent view
of the keyboard state (e.g. current layout, Caps Lock, et al).  It
should be sent after a keyboard enter event, and also immediately after
any key event which changes the modifier state.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agoAlways reset keyboard and pointer focus
Daniel Stone [Wed, 30 May 2012 15:31:46 +0000 (16:31 +0100)]
Always reset keyboard and pointer focus

If wl_pointer_set_focus or wl_keyboard_set_focus have been called before
a listener has been established for that seat and client combination,
the focus window will be set but the focus resource will be NULL.  This
changes these functions to always attempt to search for the relevant
focus resource, allowing the resource to be set by calling
wl_keyboard_set_focus and wl_pointer_set_focus again when a listener has
been established.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agocursor: Fix warning with objdir != srcdir build
Daniel Stone [Wed, 30 May 2012 15:31:45 +0000 (16:31 +0100)]
cursor: Fix warning with objdir != srcdir build

Make sure we find the right include paths.

krh: Edited to use $(top_builddir)

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agoWayland: logging: replace printf by wl_log
Martin Minarik [Tue, 29 May 2012 15:38:51 +0000 (17:38 +0200)]
Wayland: logging: replace printf by wl_log

12 years agoWayland: logging
Martin Minarik [Tue, 29 May 2012 15:37:02 +0000 (17:37 +0200)]
Wayland: logging

The core libwayland libraries should not handle logging, only passing
the error messages to subscribed functions.
An application linked to libwayland-server or libwayland-client
will be able to set own functions (one per library) to handle error
messages.

Change in this series: make the wl_log return int, because
of compatibility with printf. It will return the number of bytes logged.

12 years agotests: update gitignore
Pekka Paalanen [Tue, 29 May 2012 13:53:21 +0000 (16:53 +0300)]
tests: update gitignore

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agobuild: add uninstalled pkg-config files
Pekka Paalanen [Tue, 29 May 2012 13:53:20 +0000 (16:53 +0300)]
build: add uninstalled pkg-config files

Required for building apps against wayland libraries that have not been
installed.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agocursor: Link libwayland-cursor to libwayland-client
Rob Bradford [Tue, 29 May 2012 13:10:30 +0000 (14:10 +0100)]
cursor: Link libwayland-cursor to libwayland-client

LDADD is only used when linking programs not libraries.

Spotted-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agodata-device: implement drags with no data source for self-dnd
Ander Conselvan de Oliveira [Tue, 29 May 2012 07:58:26 +0000 (10:58 +0300)]
data-device: implement drags with no data source for self-dnd

Properly handle a drag with no data source, i.e., don't crash and send
events only to the client that initiated the drag. This way a client can
do self drag and drop without offering anything to other clients.

12 years agodata-device: fix crash when a client dies during a drag with an icon
Ander Conselvan de Oliveira [Fri, 25 May 2012 07:40:28 +0000 (10:40 +0300)]
data-device: fix crash when a client dies during a drag with an icon

The commit that split wl_input_device into wl_seat and friends changed
erroneously the drag icon destroy listener, causing it to operate into
an invalid pointer to a wl_seat.

12 years agowayland-cursor: load all cursors from a theme on wl_cursor_theme_load
Ander Conselvan de Oliveira [Thu, 24 May 2012 13:17:48 +0000 (16:17 +0300)]
wayland-cursor: load all cursors from a theme on wl_cursor_theme_load

12 years agowayland-cursor: remove enum wl_cursor_type
Ander Conselvan de Oliveira [Thu, 24 May 2012 13:17:47 +0000 (16:17 +0300)]
wayland-cursor: remove enum wl_cursor_type

Defining a list of all cursors a theme, client or toolkit should have
is not the purpose of libwayland-cursor. The cursor type enum existed
for making lookups faster, but this kind of optmization belongs in the
toolkits.

12 years agoshm: use mremap on pool resize
Ander Conselvan de Oliveira [Wed, 23 May 2012 13:09:55 +0000 (16:09 +0300)]
shm: use mremap on pool resize

12 years agoWayland: Add missing extern "C"
Yan Wang [Wed, 23 May 2012 06:14:30 +0000 (14:14 +0800)]
Wayland: Add missing extern "C"

Add extern "C" macro definition for C++.

12 years agofix typo
Diego Viola [Wed, 23 May 2012 06:08:08 +0000 (02:08 -0400)]
fix typo

12 years agocursor: Fix unsigned/signed comparisons
Kristian Høgsberg [Wed, 23 May 2012 02:41:21 +0000 (22:41 -0400)]
cursor: Fix unsigned/signed comparisons

12 years agoshm: Zero busy count for allocated buffers
Rob Bradford [Tue, 22 May 2012 17:48:14 +0000 (18:48 +0100)]
shm: Zero busy count for allocated buffers

This avoids a valgrind error like:

==31496== Conditional jump or move depends on uninitialised value(s)
==31496==    at 0x407620: weston_buffer_post_release (compositor.c:928)
==31496==    by 0x406AEB: weston_surface_attach (compositor.c:725)
==31496==    by 0x409EB8: pointer_attach (compositor.c:2009)
==31496==    by 0x34ECE05D63: ffi_call_unix64 (unix64.S:75)
==31496==    by 0x34ECE05784: ffi_call (ffi64.c:486)
==31496==    by 0x5674C4D: wl_closure_invoke (connection.c:770)
==31496==    by 0x566ECCB: wl_client_connection_data (wayland-server.c:255)
==31496==    by 0x56722F9: wl_event_source_fd_dispatch (event-loop.c:79)
==31496==    by 0x5672C99: wl_event_loop_dispatch (event-loop.c:410)
==31496==    by 0x56705FF: wl_display_run (wayland-server.c:1004)
==31496==    by 0x40C775: main (compositor.c:2937)
==31496==  Uninitialised value was created by a heap allocation
==31496==    at 0x4A074CD: malloc (vg_replace_malloc.c:236)
==31496==    by 0x5670EA7: shm_pool_create_buffer (wayland-shm.c:113)
==31496==    by 0x34ECE05D63: ffi_call_unix64 (unix64.S:75)
==31496==    by 0x34ECE05784: ffi_call (ffi64.c:486)
==31496==    by 0x5674C4D: wl_closure_invoke (connection.c:770)
==31496==    by 0x566ECCB: wl_client_connection_data (wayland-server.c:255)
==31496==    by 0x56722F9: wl_event_source_fd_dispatch (event-loop.c:79)
==31496==    by 0x5672C99: wl_event_loop_dispatch (event-loop.c:410)
==31496==    by 0x56705FF: wl_display_run (wayland-server.c:1004)
==31496==    by 0x40C775: main (compositor.c:2937)

12 years agoserver: Initialise serial number counter for wl_display
Rob Bradford [Tue, 22 May 2012 17:48:13 +0000 (18:48 +0100)]
server: Initialise serial number counter for wl_display

This ends up propagating through and creating a valgrind error like:

==22573== Conditional jump or move depends on uninitialised value(s)
==22573==    at 0x409E57: pointer_attach (compositor.c:1999)
==22573==    by 0x34ECE05D63: ffi_call_unix64 (unix64.S:75)
==22573==    by 0x34ECE05784: ffi_call (ffi64.c:486)
==22573==    by 0x5674C45: wl_closure_invoke (connection.c:770)
==22573==    by 0x566ECCB: wl_client_connection_data (wayland-server.c:255)
==22573==    by 0x56722F1: wl_event_source_fd_dispatch (event-loop.c:79)
==22573==    by 0x5672C91: wl_event_loop_dispatch (event-loop.c:410)
==22573==    by 0x56705F4: wl_display_run (wayland-server.c:1003)
==22573==    by 0x40C775: main (compositor.c:2937)

12 years agoIntroduce libwayland-cursor, a cursor helper library
Ander Conselvan de Oliveira [Tue, 22 May 2012 12:39:41 +0000 (15:39 +0300)]
Introduce libwayland-cursor, a cursor helper library

The purpose of this library is to be the equivalent of libXcursor in
the X world. This library is compatible with X cursor themes and loads
them directly into an shm pool making it easy for the clients to get
buffer for each cursor image.

The code for handling the X cursor theme was taken from libXcursor. The
files cursor/xcursor.[ch] are a stripped down version of that library
containing only the interfaces necessary for implementing the wayland
counterpart.

12 years agoshm: Add request for resizing pools
Ander Conselvan de Oliveira [Tue, 22 May 2012 12:39:40 +0000 (15:39 +0300)]
shm: Add request for resizing pools

12 years agoprotocol: use transient flags for activate or not surfaces
Tiago Vignatti [Mon, 21 May 2012 13:47:44 +0000 (16:47 +0300)]
protocol: use transient flags for activate or not surfaces

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
12 years agodoc: Update docs to refer to wl_seat instead of wl_input_device
Kristian Høgsberg [Wed, 16 May 2012 18:25:45 +0000 (14:25 -0400)]
doc: Update docs to refer to wl_seat instead of wl_input_device

12 years agoConvert wl_input_device to wl_seat (and friends)
Daniel Stone [Wed, 16 May 2012 17:44:40 +0000 (18:44 +0100)]
Convert wl_input_device to wl_seat (and friends)

wl_input_device has been both renamed and split.  wl_seat is now a
virtual object representing a group of logically related input devices
with related focus.

It now only generates one event: to let clients know that it has new
capabilities.  It takes requests which hand back objects for the
wl_pointer, wl_keyboard and wl_touch interfaces it exposes which all
provide the old input interface, just under different names.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
12 years agoAdd missing alt attributes in publican docs.
Darxus [Mon, 14 May 2012 20:41:10 +0000 (16:41 -0400)]
Add missing alt attributes in publican docs.

Haven't figured out how to regenerate the html, so it's not tested.
Looks like remaining html errors will be fixed in the next publican
release:  https://bugzilla.redhat.com/show_bug.cgi?id=788576

12 years agotests: add noop to fixed-benchmark
Pekka Paalanen [Tue, 15 May 2012 07:29:12 +0000 (10:29 +0300)]
tests: add noop to fixed-benchmark

I was just curious of how much the looping takes time without
conversion, so I added this.

My results on Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz:

benchmarked noop: 1.876349827s
benchmarked magic: 2.245844470s
benchmarked div: 12.709085309s
benchmarked mul: 7.504838141s

Mul seems to take 15x the time magic does, cool!

Btw. the simple default cast of int32_t to double is slower than magic
for me, hence the use of union.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
12 years agoOptimize wl_fixed_t to/from double conversion functions
Kristian Høgsberg [Sat, 12 May 2012 03:36:20 +0000 (23:36 -0400)]
Optimize wl_fixed_t to/from double conversion functions

12 years agoTODO: Strike the last xkbcommon issues
Kristian Høgsberg [Fri, 11 May 2012 15:27:22 +0000 (11:27 -0400)]
TODO: Strike the last xkbcommon issues

12 years agoprotocol: Specify that the fullscreen framerate parameter is also mHz
Kristian Høgsberg [Thu, 10 May 2012 18:13:05 +0000 (14:13 -0400)]
protocol: Specify that the fullscreen framerate parameter is also mHz

12 years agoprotocol: Back out accidentally committed wl_seat changes
Kristian Høgsberg [Thu, 10 May 2012 16:09:56 +0000 (12:09 -0400)]
protocol: Back out accidentally committed wl_seat changes