elput: Check return of calibration_get_default_matrix function
authorChris Michael <cpmichael@osg.samsung.com>
Fri, 20 May 2016 15:28:48 +0000 (11:28 -0400)
committerChris Michael <cpmichael@osg.samsung.com>
Fri, 20 May 2016 15:30:33 +0000 (11:30 -0400)
We should be checking the return value when we try to get the default
matrix calibration for an input device so we can fail properly

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
src/lib/elput/elput_evdev.c

index 477dc05..4537019 100644 (file)
@@ -643,16 +643,19 @@ _pointer_motion_send(Elput_Device *edev)
    else if (y >= ptr->miny + ptr->maxh)
      y = ptr->miny + ptr->maxh - 1;
 
+   ptr->x = x;
+   ptr->y = y;
+
    ev->window = edev->window;
    ev->event_window = edev->window;
    ev->root_window = edev->window;
    ev->timestamp = ptr->timestamp;
    ev->same_screen = 1;
 
-   ev->x = x;
-   ev->y = y;
-   ev->root.x = x;
-   ev->root.y = y;
+   ev->x = ptr->x;
+   ev->y = ptr->y;
+   ev->root.x = ptr->x;
+   ev->root.y = ptr->y;
 
    kbd = _evdev_keyboard_get(edev->seat);
    if (kbd) _keyboard_modifiers_update(kbd, edev->seat);
@@ -1132,7 +1135,7 @@ _evdev_device_calibrate(Elput_Device *dev)
    if ((w == 0) || (h == 0)) return;
 
    if ((!libinput_device_config_calibration_has_matrix(dev->device)) ||
-       (libinput_device_config_calibration_get_default_matrix(dev->device, cal)))
+       (libinput_device_config_calibration_get_default_matrix(dev->device, cal) != 0))
      return;
 
    sysname = libinput_device_get_sysname(dev->device);