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>
diff --git a/desktop-shell/exposay.c b/desktop-shell/exposay.c
index e59d17e..3fa585a 100644
--- a/desktop-shell/exposay.c
+++ b/desktop-shell/exposay.c
@@ -653,10 +653,10 @@
}
void
-exposay_binding(struct weston_seat *seat, enum weston_keyboard_modifier modifier,
+exposay_binding(struct weston_keyboard *keyboard, enum weston_keyboard_modifier modifier,
void *data)
{
struct desktop_shell *shell = data;
- exposay_set_state(shell, EXPOSAY_TARGET_OVERVIEW, seat);
+ exposay_set_state(shell, EXPOSAY_TARGET_OVERVIEW, keyboard->seat);
}