[packages/clutter] - added libinput patch (update to libinput 0.4.0 API) - release 2

qboosh qboosh at pld-linux.org
Wed Jul 2 19:36:13 CEST 2014


commit 417d25e9e73e24d544fcc44ff016f9fc06262915
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Wed Jul 2 19:40:10 2014 +0200

    - added libinput patch (update to libinput 0.4.0 API)
    - release 2

 clutter-libinput.patch | 166 +++++++++++++++++++++++++++++++++++++++++++++++++
 clutter.spec           |  10 +--
 2 files changed, 172 insertions(+), 4 deletions(-)
---
diff --git a/clutter.spec b/clutter.spec
index bc5a082..e917355 100644
--- a/clutter.spec
+++ b/clutter.spec
@@ -9,13 +9,14 @@ Summary:	Library for rich GUIs
 Summary(pl.UTF-8):	Biblioteka do bogatych graficznych interfejsów użytkownika
 Name:		clutter
 Version:	1.18.2
-Release:	1
+Release:	2
 License:	LGPL v2+
 Group:		Libraries
 Source0:	http://ftp.gnome.org/pub/GNOME/sources/clutter/1.18/%{name}-%{version}.tar.xz
 # Source0-md5:	471f5ea423e20d4140c7771873daef29
 Patch0:		gtkdoc.patch
 Patch1:		missing.patch
+Patch2:		%{name}-libinput.patch
 URL:		http://www.clutter-project.org/
 BuildRequires:	OpenGL-GLX-devel
 BuildRequires:	atk-devel >= 1:2.5.3
@@ -34,7 +35,7 @@ BuildRequires:	gtk+3-devel >= 3.4.0
 BuildRequires:	gtk-doc >= 1.20
 BuildRequires:	json-glib-devel >= 0.12.0
 %{?with_evdev:BuildRequires:	libevdev-devel}
-%{?with_evdev:BuildRequires:	libinput-devel >= 0.1.0}
+%{?with_evdev:BuildRequires:	libinput-devel >= 0.4.0}
 BuildRequires:	libtool >= 2:2.2.6
 BuildRequires:	libxslt-progs
 BuildRequires:	pango-devel >= 1:1.30
@@ -63,7 +64,7 @@ Requires:	cogl >= 1.18.0
 Requires:	glib2 >= 1:2.37.3
 Requires:	gtk+3 >= 3.4.0
 Requires:	json-glib >= 0.12.0
-%{?with_evdev:Requires:	libinput >= 0.1.0}
+%{?with_evdev:Requires:	libinput >= 0.4.0}
 Requires:	pango >= 1:1.30
 %{?with_evdev:Requires:	udev-libs >= 1:136}
 %{?with_evdev:Provides:	clutter(evdev) = %{version}-%{release}}
@@ -106,7 +107,7 @@ Requires:	gdk-pixbuf2-devel >= 2.0
 Requires:	glib2-devel >= 1:2.37.3
 Requires:	gtk+3-devel >= 3.4.0
 Requires:	json-glib-devel >= 0.12.0
-%{?with_evdev:Requires:	libinput-devel >= 0.1.0}
+%{?with_evdev:Requires:	libinput-devel >= 0.4.0}
 Requires:	pango-devel >= 1:1.30
 %{?with_evdev:Requires:	udev-devel >= 1:136}
 %{?with_wayland:Requires: wayland-devel}
@@ -160,6 +161,7 @@ Dokumentacja API clutter.
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 %{__gtkdocize}
diff --git a/clutter-libinput.patch b/clutter-libinput.patch
new file mode 100644
index 0000000..172e26b
--- /dev/null
+++ b/clutter-libinput.patch
@@ -0,0 +1,166 @@
+--- clutter-1.18.2/clutter/evdev/clutter-device-manager-evdev.c.orig	2014-04-02 19:48:36.000000000 +0200
++++ clutter-1.18.2/clutter/evdev/clutter-device-manager-evdev.c	2014-07-02 19:01:18.679709010 +0200
+@@ -375,8 +375,8 @@ notify_absolute_motion (ClutterInputDevi
+ static void
+ notify_relative_motion (ClutterInputDevice *input_device,
+                         guint32             time_,
+-                        li_fixed_t          dx,
+-                        li_fixed_t          dy)
++                        double              dx,
++                        double              dy)
+ {
+   gfloat new_x, new_y;
+   ClutterInputDeviceEvdev *device_evdev;
+@@ -391,17 +391,9 @@ notify_relative_motion (ClutterInputDevi
+   device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (input_device);
+   seat = _clutter_input_device_evdev_get_seat (device_evdev);
+ 
+-  /* Append previously discarded fraction. */
+-  dx += device_evdev->dx_frac;
+-  dy += device_evdev->dy_frac;
+-
+   clutter_input_device_get_coords (seat->core_pointer, NULL, &point);
+-  new_x = point.x + li_fixed_to_int (dx);
+-  new_y = point.y + li_fixed_to_int (dy);
+-
+-  /* Save the discarded fraction part for next motion event. */
+-  device_evdev->dx_frac = (dx < 0 ? -1 : 1) * (0xff & dx);
+-  device_evdev->dy_frac = (dy < 0 ? -1 : 1) * (0xff & dy);
++  new_x = point.x + dx;
++  new_y = point.y + dy;
+ 
+   notify_absolute_motion (input_device, time_, new_x, new_y);
+ }
+@@ -988,7 +980,7 @@ process_device_event (ClutterDeviceManag
+         time = libinput_event_keyboard_get_time (key_event);
+         key = libinput_event_keyboard_get_key (key_event);
+         key_state = libinput_event_keyboard_get_key_state (key_event) ==
+-                    LIBINPUT_KEYBOARD_KEY_STATE_PRESSED;
++                    LIBINPUT_KEY_STATE_PRESSED;
+         notify_key_device (device, time, key, key_state, TRUE);
+ 
+         break;
+@@ -997,7 +989,7 @@ process_device_event (ClutterDeviceManag
+     case LIBINPUT_EVENT_POINTER_MOTION:
+       {
+         guint32 time;
+-        li_fixed_t dx, dy;
++        double dx, dy;
+         struct libinput_event_pointer *motion_event =
+           libinput_event_get_pointer_event (event);
+         device = libinput_device_get_user_data (libinput_device);
+@@ -1013,7 +1005,7 @@ process_device_event (ClutterDeviceManag
+     case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE:
+       {
+         guint32 time;
+-        li_fixed_t x, y;
++        double x, y;
+         gfloat stage_width, stage_height;
+         ClutterStage *stage;
+         struct libinput_event_pointer *motion_event =
+@@ -1032,10 +1024,7 @@ process_device_event (ClutterDeviceManag
+                                                                stage_width);
+         y = libinput_event_pointer_get_absolute_y_transformed (motion_event,
+                                                                stage_height);
+-        notify_absolute_motion (device,
+-                                time,
+-                                li_fixed_to_double(x),
+-                                li_fixed_to_double(y));
++        notify_absolute_motion (device, time, x, y);
+ 
+         break;
+       }
+@@ -1050,7 +1039,7 @@ process_device_event (ClutterDeviceManag
+         time = libinput_event_pointer_get_time (button_event);
+         button = libinput_event_pointer_get_button (button_event);
+         button_state = libinput_event_pointer_get_button_state (button_event) ==
+-                       LIBINPUT_POINTER_BUTTON_STATE_PRESSED;
++                       LIBINPUT_BUTTON_STATE_PRESSED;
+         notify_button (device, time, button, button_state);
+ 
+         break;
+@@ -1066,18 +1055,17 @@ process_device_event (ClutterDeviceManag
+         device = libinput_device_get_user_data (libinput_device);
+ 
+         time = libinput_event_pointer_get_time (axis_event);
+-        value = li_fixed_to_double (
+-          libinput_event_pointer_get_axis_value (axis_event));
++        value = libinput_event_pointer_get_axis_value (axis_event);
+         axis = libinput_event_pointer_get_axis (axis_event);
+ 
+         switch (axis)
+           {
+-          case LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL:
++          case LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL:
+             dx = 0;
+             dy = value;
+             break;
+ 
+-          case LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL:
++          case LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL:
+             dx = value;
+             dy = 0;
+             break;
+@@ -1187,18 +1175,23 @@ clutter_device_manager_evdev_constructed
+   manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (gobject);
+   priv = manager_evdev->priv;
+ 
+-  priv->libinput = libinput_udev_create_for_seat (&libinput_interface,
+-                                                  manager_evdev,
+-                                                  udev,
+-                                                  "seat0");
+-  udev_unref (udev);
++  priv->libinput = libinput_udev_create_context (&libinput_interface, manager_evdev, udev);
++  if (priv->libinput == NULL)
++    {
++      g_critical ("Failed to create libinput object");
++      return;
++    }
+ 
+-  if (!priv->libinput)
++  if (libinput_udev_assign_seat (priv->libinput, "seat0") == -1)
+     {
+-      g_warning ("Failed to create libinput object");
++      g_critical ("Failed to assign a seat to the libinput object.");
++      libinput_unref (priv->libinput);
++      priv->libinput = NULL;
+       return;
+     }
+ 
++  udev_unref (udev);
++
+   priv->main_seat = clutter_seat_evdev_new (manager_evdev);
+ 
+   dispatch_libinput (manager_evdev);
+@@ -1263,7 +1256,8 @@ clutter_device_manager_evdev_finalize (G
+   if (priv->constrain_data_notify)
+     priv->constrain_data_notify (priv->constrain_data);
+ 
+-  libinput_destroy (priv->libinput);
++  if (priv->libinput != NULL)
++    libinput_unref (priv->libinput);
+ 
+   G_OBJECT_CLASS (clutter_device_manager_evdev_parent_class)->finalize (object);
+ }
+--- clutter-1.18.2/clutter/evdev/clutter-input-device-evdev.h.orig	2014-04-02 19:48:36.000000000 +0200
++++ clutter-1.18.2/clutter/evdev/clutter-input-device-evdev.h	2014-07-02 18:38:58.223098663 +0200
+@@ -64,8 +64,6 @@ struct _ClutterInputDeviceEvdev
+ 
+   struct libinput_device *libinput_device;
+   ClutterSeatEvdev *seat;
+-  li_fixed_t dx_frac;
+-  li_fixed_t dy_frac;
+ };
+ 
+ GType                     _clutter_input_device_evdev_get_type        (void) G_GNUC_CONST;
+--- clutter-1.18.2/configure.ac.orig	2014-04-14 23:26:17.000000000 +0200
++++ clutter-1.18.2/configure.ac	2014-07-02 18:39:27.299764046 +0200
+@@ -146,7 +146,7 @@ m4_define([uprof_req_version],
+ m4_define([gtk_doc_req_version],        [1.20])
+ m4_define([xcomposite_req_version],     [0.4])
+ m4_define([gdk_req_version],            [3.3.18])
+-m4_define([libinput_req_version],       [0.1.0])
++m4_define([libinput_req_version],       [0.4.0])
+ m4_define([libudev_req_version],        [136])
+ 
+ AC_SUBST([GLIB_REQ_VERSION],       [glib_req_version])
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/clutter.git/commitdiff/417d25e9e73e24d544fcc44ff016f9fc06262915



More information about the pld-cvs-commit mailing list