• Pekka Paalanen's avatar
    libweston: introduce notify_touch_normalized() and doc · f406253d
    Pekka Paalanen authored
    notify_touch_normalized() is an extended form of notify_touch(), adding
    normalized touch coordinates which are necessary for calibrating a
    It would be possible to invert the transformation and convert from
    global coordinates to normalized device coordinates in input.c without
    adding this API, but this way it is more robust against code changes.
    Recovering normalized device coordinates is necessary because libinput
    calibration matrix must be given in normalized units, and it would be
    difficult to compute otherwise. Libinput API does not offer normalized
    coordinates directly either, but those can be fetched by pretending the
    output resolution is 1x1.
    Anticipating touch calibration mode, the old notify_touch() is renamed
    into a private process_touch_normal(), and the new
    notify_touch_normalized() delegates to it.
    Co-developed by Louis-Francis and Pekka.
    - introduce struct weston_point2d_device_normalized
    - rename notify_touch_cal() to notify_touch_normalized()
    Cc: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
    Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
    v1 Tested-by: Matt Hoosier <matt.hoosier@gmail.com>
    Reviewed-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
libinput-device.c 21.4 KB