evdev: plug memory leak on libevdev_new_from_fd failure
[platform/upstream/libinput.git] / src / evdev-mt-touchpad.h
index 689687e..83edf4f 100644 (file)
@@ -33,6 +33,8 @@
 #define TOUCHPAD_HISTORY_LENGTH 4
 #define TOUCHPAD_MIN_SAMPLES 4
 
+#define VENDOR_ID_APPLE 0x5ac
+
 enum touchpad_event {
        TOUCHPAD_EVENT_NONE             = 0,
        TOUCHPAD_EVENT_MOTION           = (1 << 0),
@@ -101,9 +103,7 @@ struct tp_touch {
        struct tp_dispatch *tp;
        enum touch_state state;
        bool dirty;
-       bool fake;                              /* a fake touch */
        bool is_pointer;                        /* the pointer-controlling touch */
-       bool is_palm;
        int32_t x;
        int32_t y;
        uint64_t millis;
@@ -140,16 +140,25 @@ struct tp_touch {
        struct {
                enum tp_tap_touch_state state;
        } tap;
+
+       struct {
+               bool is_palm;
+               int32_t x, y;  /* first coordinates if is_palm == true */
+               uint32_t time; /* first timestamp if is_palm == true */
+       } palm;
 };
 
 struct tp_dispatch {
        struct evdev_dispatch base;
        struct evdev_device *device;
        unsigned int nfingers_down;             /* number of fingers down */
+       unsigned int old_nfingers_down;         /* previous no fingers down */
        unsigned int slot;                      /* current slot */
        bool has_mt;
+       bool semi_mt;
 
-       unsigned int ntouches;                  /* number of slots */
+       unsigned int real_touches;              /* number of slots */
+       unsigned int ntouches;                  /* no slots inc. fakes */
        struct tp_touch *touches;               /* len == ntouches */
        unsigned int fake_touches;              /* fake touch mask */