weston: use libinput-0.5

This commit is contained in:
Enno Boland 2014-08-09 13:00:35 +02:00
parent 64b08f15eb
commit 4eac611aae
3 changed files with 199 additions and 3 deletions

View File

@ -0,0 +1,95 @@
From 26714b4718ec877418c9a8faa111d8b9def7b0a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=85dahl?= <jadahl@gmail.com>
Date: Mon, 2 Jun 2014 23:15:48 +0200
Subject: libinput: Use floating point instead of fixed point numbers
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Also update configure.ac to require libinput 0.3 when enabled, as it is
the version where double replaced li_fixed_t.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
diff --git configure.ac configure.ac
index e2bf38d..16e813d 100644
--- configure.ac
+++ configure.ac
@@ -159,7 +159,7 @@ AC_ARG_ENABLE(libinput-backend, [ --enable-libinput-backend],,
AM_CONDITIONAL([ENABLE_LIBINPUT_BACKEND], [test x$enable_libinput_backend = xyes])
if test x$enable_libinput_backend = xyes; then
AC_DEFINE([BUILD_LIBINPUT_BACKEND], [1], [Build the libinput input device backend])
- PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.1.0])
+ PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.3.0])
fi
diff --git src/libinput-device.c src/libinput-device.c
index 4605a76..2ba4ec3 100644
--- src/libinput-device.c
+++ src/libinput-device.c
@@ -73,11 +73,14 @@ handle_pointer_motion(struct libinput_device *libinput_device,
{
struct evdev_device *device =
libinput_device_get_user_data(libinput_device);
+ wl_fixed_t dx, dy;
+ dx = wl_fixed_from_double(libinput_event_pointer_get_dx(pointer_event));
+ dy = wl_fixed_from_double(libinput_event_pointer_get_dy(pointer_event));
notify_motion(device->seat,
libinput_event_pointer_get_time(pointer_event),
- libinput_event_pointer_get_dx(pointer_event),
- libinput_event_pointer_get_dy(pointer_event));
+ dx,
+ dy);
}
static void
@@ -99,10 +102,12 @@ handle_pointer_motion_absolute(
width = device->output->current_mode->width;
height = device->output->current_mode->height;
- x = libinput_event_pointer_get_absolute_x_transformed(pointer_event,
- width);
- y = libinput_event_pointer_get_absolute_y_transformed(pointer_event,
- height);
+ x = wl_fixed_from_double(
+ libinput_event_pointer_get_absolute_x_transformed(pointer_event,
+ width));
+ y = wl_fixed_from_double(
+ libinput_event_pointer_get_absolute_y_transformed(pointer_event,
+ height));
weston_output_transform_coordinate(device->output, x, y, &x, &y);
notify_motion_absolute(device->seat, time, x, y);
@@ -127,11 +132,13 @@ handle_pointer_axis(struct libinput_device *libinput_device,
{
struct evdev_device *device =
libinput_device_get_user_data(libinput_device);
+ double value;
+ value = libinput_event_pointer_get_axis_value(pointer_event);
notify_axis(device->seat,
libinput_event_pointer_get_time(pointer_event),
libinput_event_pointer_get_axis(pointer_event),
- libinput_event_pointer_get_axis_value(pointer_event));
+ wl_fixed_from_double(value));
}
static void
@@ -155,8 +162,10 @@ handle_touch_with_coords(struct libinput_device *libinput_device,
width = device->output->current_mode->width;
height = device->output->current_mode->height;
- x = libinput_event_touch_get_x_transformed(touch_event, width);
- y = libinput_event_touch_get_y_transformed(touch_event, height);
+ x = wl_fixed_from_double(
+ libinput_event_touch_get_x_transformed(touch_event, width));
+ y = wl_fixed_from_double(
+ libinput_event_touch_get_y_transformed(touch_event, height));
weston_output_transform_coordinate(device->output,
x, y, &x, &y);
--
cgit v0.10.2

View File

@ -0,0 +1,97 @@
From 3b843d3a61286d4b2a9552a3a2cae80c6b1cf8cd Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Wed, 25 Jun 2014 14:07:36 +1000
Subject: Require libinput 0.4.0
No functional changes, just adjusting for API changes in libinput:
- libinput_destroy() replaced by libinput_unref()
- log functions now take a libinput context, userdata is gone
- udev seat creation is now libinput_udev_create_context() and
libinput_udev_assign_seat()
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
diff --git configure.ac configure.ac
index b4511fc..648bee8 100644
--- configure.ac
+++ configure.ac
@@ -160,7 +160,7 @@ AC_ARG_ENABLE(libinput-backend, [ --enable-libinput-backend],,
AM_CONDITIONAL([ENABLE_LIBINPUT_BACKEND], [test x$enable_libinput_backend = xyes])
if test x$enable_libinput_backend = xyes; then
AC_DEFINE([BUILD_LIBINPUT_BACKEND], [1], [Build the libinput input device backend])
- PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.3.0])
+ PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.4.0])
fi
diff --git src/libinput-seat.c src/libinput-seat.c
index d59ae42..09cf7c7 100644
--- src/libinput-seat.c
+++ src/libinput-seat.c
@@ -252,8 +252,9 @@ udev_input_enable(struct udev_input *input)
}
static void
-libinput_log_func(enum libinput_log_priority priority, void *user_data,
- const char *format, va_list args)
+libinput_log_func(struct libinput *libinput,
+ enum libinput_log_priority priority,
+ const char *format, va_list args)
{
weston_vlog(format, args);
}
@@ -268,25 +269,34 @@ udev_input_init(struct udev_input *input, struct weston_compositor *c, struct ud
input->compositor = c;
- libinput_log_set_handler(&libinput_log_func, NULL);
-
log_priority = getenv("WESTON_LIBINPUT_LOG_PRIORITY");
+ input->libinput = libinput_udev_create_context(&libinput_interface,
+ input, udev);
+ if (!input->libinput) {
+ return -1;
+ }
+
+ libinput_log_set_handler(input->libinput, &libinput_log_func);
+
if (log_priority) {
if (strcmp(log_priority, "debug") == 0) {
- libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_DEBUG);
+ libinput_log_set_priority(input->libinput,
+ LIBINPUT_LOG_PRIORITY_DEBUG);
} else if (strcmp(log_priority, "info") == 0) {
- libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_INFO);
+ libinput_log_set_priority(input->libinput,
+ LIBINPUT_LOG_PRIORITY_INFO);
} else if (strcmp(log_priority, "error") == 0) {
- libinput_log_set_priority(LIBINPUT_LOG_PRIORITY_ERROR);
+ libinput_log_set_priority(input->libinput,
+ LIBINPUT_LOG_PRIORITY_ERROR);
}
}
- input->libinput = libinput_udev_create_for_seat(&libinput_interface, input,
- udev, seat_id);
- if (!input->libinput) {
+ if (libinput_udev_assign_seat(input->libinput, seat_id) != 0) {
+ libinput_unref(input->libinput);
return -1;
}
+
process_events(input);
return udev_input_enable(input);
@@ -300,7 +310,7 @@ udev_input_destroy(struct udev_input *input)
wl_event_source_remove(input->libinput_source);
wl_list_for_each_safe(seat, next, &input->compositor->seat_list, base.link)
udev_seat_destroy(seat);
- libinput_destroy(input->libinput);
+ libinput_unref(input->libinput);
}
static void
--
cgit v0.10.2

View File

@ -1,7 +1,7 @@
# Template file for 'weston'.
pkgname=weston
version=1.5.0
revision=4
revision=5
build_style=gnu-configure
# XXX enable rdp compositor if freerdp is updated to >=1.1.
configure_args="--enable-libinput-backend
@ -13,11 +13,11 @@ license="MIT"
distfiles="http://wayland.freedesktop.org/releases/${pkgname}-${version}.tar.xz"
checksum=06388ba04ac79aa72d685cc1a8e646ddb2b8cfe11fcc742294f9addac48b7684
hostmakedepends="pkg-config wayland-devel>=${version}"
hostmakedepends="pkg-config wayland-devel>=${version} autoconf automake libtool"
makedepends="libpng-devel>=1.6 wayland-devel>=${version} libxkbcommon-devel
pixman-devel pango-devel cairo-devel>=1.12.14_5 mtdev-devel libwebp-devel>=0.4.0
poppler-glib-devel pam-devel lcms2-devel libudev-devel libdrm-devel
libinput-devel libxcb-devel libXcursor-devel colord-devel"
libinput-devel>=0.5.0_1 libxcb-devel libXcursor-devel colord-devel"
# cairo built with gles2 option.
depends="cairo>=1.12.14_5"
@ -74,6 +74,10 @@ x86_64|i686)
;;
esac
pre_configure() {
autoreconf -fi
}
post_install() {
vinstall COPYING 644 usr/share/license/$pkgname
# Remove development files.