input: Pass the appropriate pointer type to bindings instead of a seat

Normally we need to check if a seat's [device_type]_count is > 0 before
we can use the associated pointer.  However, in a binding you're
guaranteed that the seat has a device of that type.  If we pass in
that type instead of the seat, it's obvious we don't have to test it.

The bindings can still get the seat pointer via whatever->seat if they
need it.

This is preparation for a follow up patch that prevents direct access
to seat->device_type pointers, and this will save us a few tests at
that point.

Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
This commit is contained in:
Derek Foreman
2015-07-15 13:00:36 -05:00
committed by Bryce Harrington
parent 0720ea36c8
commit 8ae2db5b0c
15 changed files with 116 additions and 104 deletions
+2 -2
View File
@@ -355,8 +355,8 @@ shell_destroy(struct wl_listener *listener, void *data)
}
static void
terminate_binding(struct weston_seat *seat, uint32_t time, uint32_t key,
void *data)
terminate_binding(struct weston_keyboard *keyboard, uint32_t time,
uint32_t key, void *data)
{
struct weston_compositor *compositor = data;