pad: add helper function to access the libinput context

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2016-06-09 11:23:43 +10:00
parent 3824e161ed
commit f71329d0d8
2 changed files with 9 additions and 3 deletions

View file

@ -132,7 +132,7 @@ pad_process_absolute(struct pad_dispatch *pad,
pad->have_abs_misc_terminator = true;
break;
default:
log_info(device->base.seat->libinput,
log_info(pad_libinput_context(pad),
"Unhandled EV_ABS event code %#x\n", e->code);
break;
}
@ -408,7 +408,7 @@ pad_process(struct evdev_dispatch *dispatch,
* now */
break;
default:
log_error(device->base.seat->libinput,
log_error(pad_libinput_context(pad),
"Unexpected event type %s (%#x)\n",
libevdev_event_type_get_name(e->type),
e->type);
@ -421,7 +421,7 @@ pad_suspend(struct evdev_dispatch *dispatch,
struct evdev_device *device)
{
struct pad_dispatch *pad = (struct pad_dispatch *)dispatch;
struct libinput *libinput = device->base.seat->libinput;
struct libinput *libinput = pad_libinput_context(pad);
unsigned int code;
for (code = KEY_ESC; code < KEY_CNT; code++) {

View file

@ -66,4 +66,10 @@ struct pad_dispatch {
} sendevents;
};
static inline struct libinput *
pad_libinput_context(const struct pad_dispatch *pad)
{
return evdev_libinput_context(pad->device);
}
#endif