backend/libinput: add assertions

This commit is contained in:
emersion 2018-09-17 21:53:03 +02:00
parent bc34486c04
commit 7bcf0d9599
6 changed files with 94 additions and 52 deletions

View file

@ -69,7 +69,8 @@ static void add_pad_group_from_libinput(struct wlr_tablet_pad *pad,
struct wlr_tablet_pad *create_libinput_tablet_pad(
struct libinput_device *libinput_dev) {
assert(libinput_dev);
struct wlr_tablet_pad *wlr_tablet_pad = calloc(1, sizeof(struct wlr_tablet_pad));
struct wlr_tablet_pad *wlr_tablet_pad =
calloc(1, sizeof(struct wlr_tablet_pad));
if (!wlr_tablet_pad) {
wlr_log(WLR_ERROR, "Unable to allocate wlr_tablet_pad");
return NULL;
@ -101,7 +102,8 @@ void handle_tablet_pad_button(struct libinput_event *event,
struct wlr_input_device *wlr_dev =
get_appropriate_device(WLR_INPUT_DEVICE_TABLET_PAD, libinput_dev);
if (!wlr_dev) {
wlr_log(WLR_DEBUG, "Got a tablet pad event for a device with no tablet pad?");
wlr_log(WLR_DEBUG,
"Got a tablet pad event for a device with no tablet pad?");
return;
}
struct libinput_event_tablet_pad *pevent =
@ -129,7 +131,8 @@ void handle_tablet_pad_ring(struct libinput_event *event,
struct wlr_input_device *wlr_dev =
get_appropriate_device(WLR_INPUT_DEVICE_TABLET_PAD, libinput_dev);
if (!wlr_dev) {
wlr_log(WLR_DEBUG, "Got a tablet pad event for a device with no tablet pad?");
wlr_log(WLR_DEBUG,
"Got a tablet pad event for a device with no tablet pad?");
return;
}
struct libinput_event_tablet_pad *pevent =
@ -156,7 +159,8 @@ void handle_tablet_pad_strip(struct libinput_event *event,
struct wlr_input_device *wlr_dev =
get_appropriate_device(WLR_INPUT_DEVICE_TABLET_PAD, libinput_dev);
if (!wlr_dev) {
wlr_log(WLR_DEBUG, "Got a tablet pad event for a device with no tablet pad?");
wlr_log(WLR_DEBUG,
"Got a tablet pad event for a device with no tablet pad?");
return;
}
struct libinput_event_tablet_pad *pevent =