summaryrefslogtreecommitdiff
path: root/src/screenshooter.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2015-07-15 13:00:36 -0500
committerBryce Harrington <bryce@osg.samsung.com>2015-07-16 19:03:43 -0700
commit8ae2db5b0cc5673e442938aa176cb44ada3e20ca (patch)
tree3cd6d82774f2774bdc1fb10c77360f903bad223f /src/screenshooter.c
parent0720ea36c8ee7e957d292a9ca41f35b403f39062 (diff)
downloadweston-8ae2db5b0cc5673e442938aa176cb44ada3e20ca.tar.gz
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>
Diffstat (limited to 'src/screenshooter.c')
-rw-r--r--src/screenshooter.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/screenshooter.c b/src/screenshooter.c
index b7b8dce3..d54b47de 100644
--- a/src/screenshooter.c
+++ b/src/screenshooter.c
@@ -286,8 +286,8 @@ screenshooter_sigchld(struct weston_process *process, int status)
}
static void
-screenshooter_binding(struct weston_seat *seat, uint32_t time, uint32_t key,
- void *data)
+screenshooter_binding(struct weston_keyboard *keyboard, uint32_t time,
+ uint32_t key, void *data)
{
struct screenshooter *shooter = data;
char *screenshooter_exe;
@@ -560,9 +560,10 @@ weston_recorder_destroy(struct weston_recorder *recorder)
}
static void
-recorder_binding(struct weston_seat *seat, uint32_t time, uint32_t key, void *data)
+recorder_binding(struct weston_keyboard *keyboard, uint32_t time,
+ uint32_t key, void *data)
{
- struct weston_compositor *ec = seat->compositor;
+ struct weston_compositor *ec = keyboard->seat->compositor;
struct weston_output *output;
struct wl_listener *listener = NULL;
struct weston_recorder *recorder;
@@ -586,9 +587,8 @@ recorder_binding(struct weston_seat *seat, uint32_t time, uint32_t key, void *da
recorder->destroying = 1;
weston_output_schedule_repaint(recorder->output);
} else {
- if (seat->keyboard && seat->keyboard->focus &&
- seat->keyboard->focus->output)
- output = seat->keyboard->focus->output;
+ if (keyboard->focus && keyboard->focus->output)
+ output = keyboard->focus->output;
else
output = container_of(ec->output_list.next,
struct weston_output, link);