Commit Graph

1073 Commits

Author SHA1 Message Date
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
Ander Conselvan de Oliveira
2261007953 wayland-cursor: Plug leak of filename on load_all_cursors_from_dir() 2012-06-19 11:36:31 -04:00
Daniel Stone
61260854ec 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>
2012-06-18 15:15:11 -04:00
Kristian Høgsberg
c806dde7e6 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.
2012-06-18 12:09:47 -04:00
Kristian Høgsberg
b576443a0e tests: Update test cases to new closure allocate convention 2012-06-15 16:09:39 -04:00
Kristian Høgsberg
c622350fb2 TODO: Remove cursor-as-regular-surface item 2012-06-15 11:09:36 -04:00
Ander Conselvan de Oliveira
6b861f7b4d 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.
2012-06-15 10:53:58 -04:00
Ander Conselvan de Oliveira
b6aa49455e protocol: replace pointer.attach with pointer.set_cursor 2012-06-15 10:52:50 -04:00
Kristian Høgsberg
6e94028c31 TODO: Update to account for changes from Daniel 2012-06-13 13:33:01 -04:00
Kristian Høgsberg
8dc57f4dda connection: Set closure->start in demarshal too 2012-06-13 10:45:38 -04:00
Kristian Høgsberg
46f9745c10 connection: Always malloc closure
This lets us allocate the closure just big enough and is a first step towards
a message queue.
2012-06-13 10:45:34 -04:00
Jonas Ådahl
1432bd62df wayland-server: Add destroy signal to wl_seat
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-06-12 20:18:42 -04:00
Jonas Ådahl
f36f32a0e0 wayland-util: wl_list_insert_list() should accept empty lists
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2012-06-12 20:18:38 -04:00
Ander Conselvan de Oliveira
dd8891be36 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.
2012-06-08 12:50:42 -04:00
Pekka Paalanen
c29020332a server: require XDG_RUNTIME_DIR
An arbitrary fallback to the current directory is only confusing.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-06 13:07:33 -04:00
Pekka Paalanen
0c7ca38c7f client: require XDG_RUNTIME_DIR
An arbitrary fallback to the current directory is only confusing.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-06-06 13:07:25 -04:00
Kristian Høgsberg
aa792ad3d6 Add a focus change signal for wl_pointer and wl_keyboard 2012-06-05 09:56:42 -04:00
Kristian Høgsberg
3fd1e128e9 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.
2012-06-03 23:11:34 -04:00
Kristian Høgsberg
68f058ffd3 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.
2012-06-03 17:30:12 -04:00
Daniel Stone
dff84e5638 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>
2012-06-01 10:35:48 -04:00
Kristian Høgsberg
0760297633 data-device: Handle setting a NULL selection source 2012-05-31 23:29:08 -04:00
Kristian Høgsberg
0527ad8f00 data-device: Emit selection_signal also when we lose the selection 2012-05-31 23:28:31 -04:00
Kristian Høgsberg
8f63e8013b 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.
2012-05-31 23:26:50 -04:00
Daniel Stone
cfd56ed4bc Convert wl_pointer::axis to fixed
Which allows for smooth scrolling, among other things.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 14:02:28 -04:00
Daniel Stone
872d074a43 Add key_state and button_state enums
Rather than hardcoding 0 and 1 everywhere.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 14:02:20 -04:00