Hello community,
here is the log from the commit of package xf86-input-evdev for openSUSE:Factory checked in at 2016-05-08 10:39:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xf86-input-evdev (Old)
and /work/SRC/openSUSE:Factory/.xf86-input-evdev.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "xf86-input-evdev"
Changes:
--------
--- /work/SRC/openSUSE:Factory/xf86-input-evdev/xf86-input-evdev.changes 2016-01-11 19:10:59.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.xf86-input-evdev.new/xf86-input-evdev.changes 2016-05-08 10:39:40.000000000 +0200
@@ -1,0 +2,16 @@
+Mon May 2 07:02:48 UTC 2016 - eich@suse.com
+
+- u_01-Add-a-kiosk-mode-for-touch-screens.patch
+ u_02-Add-delay-between-button-press-and-release-to-kiosk-mode.patch
+ Add click on touch (FATE#320263).
+
+-------------------------------------------------------------------
+Fri Apr 29 15:15:52 UTC 2016 - sndirsch@suse.com
+
+- Update to version 2.10.2
+ This release restores wheel emulation on absolute devices and drops the
+ forced direction locking for scroll buildup during wheel emulation since it
+ made it almost impossible to actually scroll in both directions. Since
+ horizontal scrolling is disabled by default anyway, we don't need this lock.
+
+-------------------------------------------------------------------
Old:
----
xf86-input-evdev-2.10.1.tar.bz2
xf86-input-evdev-2.10.1.tar.bz2.sig
New:
----
u_01-Add-a-kiosk-mode-for-touch-screens.patch
u_02-Add-delay-between-button-press-and-release-to-kiosk-mode.patch
xf86-input-evdev-2.10.2.tar.bz2
xf86-input-evdev-2.10.2.tar.bz2.sig
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xf86-input-evdev.spec ++++++
--- /var/tmp/diff_new_pack.i8IyWq/_old 2016-05-08 10:39:41.000000000 +0200
+++ /var/tmp/diff_new_pack.i8IyWq/_new 2016-05-08 10:39:41.000000000 +0200
@@ -17,7 +17,7 @@
Name: xf86-input-evdev
-Version: 2.10.1
+Version: 2.10.2
Release: 0
Summary: Generic Linux input driver for the Xorg X server
License: MIT
@@ -27,10 +27,13 @@
Source1: http://xorg.freedesktop.org/releases/individual/driver/%{name}-%{version}.tar.bz2.sig
Source2: %{name}.keyring
Source3: 11-evdev.conf
+Patch1: u_01-Add-a-kiosk-mode-for-touch-screens.patch
+Patch2: u_02-Add-delay-between-button-press-and-release-to-kiosk-mode.patch
-#BuildRequires: autoconf >= 2.60
-#BuildRequires: automake
-#BuildRequires: libtool
+# Next three lines are needed for u_01-Add-a-kiosk-mode-for-touch-screens.patch
+BuildRequires: autoconf >= 2.60
+BuildRequires: automake
+BuildRequires: libtool
BuildRequires: pkg-config
BuildRequires: pkgconfig(inputproto)
BuildRequires: pkgconfig(libevdev) >= 0.4
@@ -66,8 +69,12 @@
%prep
%setup -q
+%patch1 -p1
+%patch2 -p1
%build
+# Once u_01-Add-a-kiosk-mode-for-touch-screens.patch is removed this is no longer needed
+/usr/bin/autoreconf -v --install --force
%configure
make %{?_smp_mflags} V=1
++++++ u_01-Add-a-kiosk-mode-for-touch-screens.patch ++++++
From: Egbert Eich
Date: Thu Apr 14 15:30:22 2016 +0200
Subject: [PATCH 1/2]Add a 'kiosk mode' for touch screens
Patch-mainline: to be upstreamed
References: FATE#320263
Signed-off-by: Egbert Eich
This mode provides either a 'click-on-touch' or
'click-on-release'. The button to track can be
specified with an option.
Signed-off-by: Egbert Eich
---
include/evdev-properties.h | 3 +
man/evdev.man | 20 +++++
src/Makefile.am | 1 +
src/evdev.c | 13 ++-
src/evdev.h | 17 ++++
src/kioskTouch.c | 214 +++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 264 insertions(+), 4 deletions(-)
diff --git a/include/evdev-properties.h b/include/evdev-properties.h
index 8ae5ba3..29f2bd9 100644
--- a/include/evdev-properties.h
+++ b/include/evdev-properties.h
@@ -91,4 +91,7 @@
/* INT32, 3 values (vertical, horizontal, dial) */
#define EVDEV_PROP_SCROLL_DISTANCE "Evdev Scrolling Distance"
+/* Kiosk Touch mode */
+#define EVDEV_PROP_KIOSK_TOUCH "Evdev Kiosk Touch Mode"
+#define EVDEV_PROP_KIOSK_BUTTON "Evdev Kiosk Touch Button"
#endif
diff --git a/man/evdev.man b/man/evdev.man
index e70ae1f..404a88d 100644
--- a/man/evdev.man
+++ b/man/evdev.man
@@ -244,6 +244,20 @@ Sets the resolution of the device in dots per inch. The resolution is used
to scale relative motion events from mouse devices to 1000 DPI resolution. This
can be used to make high resolution mice less sensitive without turning off
acceleration. If set to 0 no scaling will be performed. Default: "0".
+.TP 7
+.BI "Option \*qKioskTouchMode\*q \*q" "N" \*q
+Specifies the Kiosk Touch mode to use. Mode
+.I N
+sets the mode: 0 - off, 1 - click on touch, 2 - click on release.
+Default: "0". Property:
+"Evdev Kiosk Touch Mode".
+.TP 7
+.BI "Option \*qKioskTouchButton\*q \*q" "N" \*q
+Specifies the Kiosk Touch button number to use. Button
+.I N
+range: 0-255.
+Default: "0". Property:
+"Evdev Kiosk Touch Button".
.SH SUPPORTED PROPERTIES
The following properties are provided by the
@@ -287,6 +301,12 @@ value.
.TP 7
.BI "Evdev Scrolling Distance"
3 32-bit values: vertical, horizontal and dial.
+.TP 7
+.BI "Evdev Kiosk Touch Mode"
+1 8-bit positive value.
+.TP 7
+.BI "Evdev Kiosk Touch Button"
+1 8-bit positive value.
.SH AUTHORS
Kristian Høgsberg, Peter Hutterer
diff --git a/src/Makefile.am b/src/Makefile.am
index 5e0c3b3..23e7421 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -40,5 +40,6 @@ AM_CPPFLAGS =-I$(top_srcdir)/include $(LIBEVDEV_CFLAGS)
emuWheel.c \
draglock.c \
apple.c \
+ kioskTouch.c \
axis_labels.h
diff --git a/src/evdev.c b/src/evdev.c
index 3176660..96d931f 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -584,6 +584,9 @@ EvdevProcessButtonEvent(InputInfoPtr pInfo, struct input_event *ev)
if (EvdevWheelEmuFilterButton(pInfo, button, value))
return;
+ if (EvdevKioskTouchFilterButton(pInfo, button, value))
+ return;
+
if (EvdevMBEmuFilterEvent(pInfo, button, value))
return;
@@ -636,7 +639,7 @@ EvdevProcessTouch(InputInfoPtr pInfo)
int type;
int slot = pEvdev->cur_slot;
- if (slot < 0 || !pEvdev->mt_mask)
+ if (slot < 0 || !pEvdev->mt_mask || EvdevKioskTouchFilterTouch(pEvdev))
return;
if (!pEvdev->slots[slot].dirty)
@@ -670,7 +673,7 @@ EvdevProcessTouch(InputInfoPtr pInfo)
valuator_mask_zero(pEvdev->mt_mask);
}
-static int
+int
num_slots(EvdevPtr pEvdev)
{
int value;
@@ -702,7 +705,7 @@ EvdevProcessTouchEvent(InputInfoPtr pInfo, struct input_event *ev)
!libevdev_has_event_code(pEvdev->dev, EV_ABS, ABS_MT_SLOT))
return;
- if (pEvdev->fake_mt)
+ if (pEvdev->fake_mt || EvdevKioskTouchFilterTouch(pEvdev))
return;
if (ev->code == ABS_MT_SLOT) {
@@ -832,7 +835,7 @@ EvdevProcessKeyEvent(InputInfoPtr pInfo, struct input_event *ev)
*/
if (!(pEvdev->flags & (EVDEV_TOUCHSCREEN | EVDEV_TABLET)) ||
- pEvdev->mt_mask)
+ (pEvdev->mt_mask && !EvdevKioskTouchFilterTouch(pEvdev)))
break;
/* Treat BTN_TOUCH from devices that only have BTN_TOUCH as
* BTN_LEFT. */
@@ -1935,6 +1938,7 @@ EvdevInit(DeviceIntPtr device)
EvdevWheelEmuInitProperty(device);
EvdevDragLockInitProperty(device);
EvdevAppleInitProperty(device);
+ EvdevKioskTouchInitProperty(device);
return Success;
}
@@ -2640,6 +2644,7 @@ EvdevPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
Evdev3BEmuPreInit(pInfo);
EvdevWheelEmuPreInit(pInfo);
EvdevDragLockPreInit(pInfo);
+ EvdevKioskTouchPreInit(pInfo);
}
return Success;
diff --git a/src/evdev.h b/src/evdev.h
index 4d44d2b..27c1cb2 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -219,6 +219,15 @@ typedef struct {
int horiz_delta;
int dial_delta;
} smoothScroll;
+ struct {
+ int mode;
+ int mode_queued;
+ /* 0: 0ff, 1: click on touch, 2: click on release */
+ unsigned int button_queued;
+ unsigned int button;
+ unsigned int state;
+ } kioskTouch;
+
/* run-time calibration */
struct {
int min_x;
@@ -245,6 +254,8 @@ typedef struct {
char *type_name;
} EvdevRec, *EvdevPtr;
+int num_slots(EvdevPtr pEvdev);
+
/* Event posting functions */
void EvdevQueueKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value);
void EvdevQueueButtonEvent(InputInfoPtr pInfo, int button, int value);
@@ -289,4 +300,10 @@ void Evdev3BEmuInitProperty(DeviceIntPtr);
void EvdevWheelEmuInitProperty(DeviceIntPtr);
void EvdevDragLockInitProperty(DeviceIntPtr);
void EvdevAppleInitProperty(DeviceIntPtr);
+
+/* Kiosk Touch */
+void EvdevKioskTouchPreInit(InputInfoPtr pInfo);
+BOOL EvdevKioskTouchFilterButton(InputInfoPtr pInfo, unsigned int button, int value);
+void EvdevKioskTouchInitProperty(DeviceIntPtr);
+BOOL EvdevKioskTouchFilterTouch(EvdevPtr pEvdev);
#endif
diff --git a/src/kioskTouch.c b/src/kioskTouch.c
new file mode 100644
index 0000000..56acd8c
--- /dev/null
+++ b/src/kioskTouch.c
@@ -0,0 +1,214 @@
+/*
+ * Copyright 2016 Egbert Eich
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of the authors
+ * not be used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. The authors make no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied
+ * warranty.
+ *
+ * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
+ * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
+ * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ */
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "evdev.h"
+
+#include
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+
+#define DEBUG(x) /*x;*/
+
+static Atom prop_ktouch = 0; /* Kiosk touch emulation on/off property */
+static Atom prop_ktouch_button = 0; /* Kiosk touch emulation button property */
+
+#define KTOUCH_STATE_ACTIVE 1U << 0
+
+void
+EvdevKioskTouchPreInit(InputInfoPtr pInfo)
+{
+ EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
+ int val;
+
+ if (!(pEvdev->flags & EVDEV_ABSOLUTE_EVENTS) &&
+ (pEvdev->flags & EVDEV_RELATIVE_EVENTS) &&
+ (pEvdev->flags & EVDEV_TOUCHPAD) &&
+ !libevdev_has_event_code(pEvdev->dev, EV_ABS, ABS_X) &&
+ !libevdev_has_event_code(pEvdev->dev, EV_ABS, ABS_Y)) {
+ pEvdev->kioskTouch.mode = -1;
+ return;
+ }
+ val = xf86SetIntOption(pInfo->options, "KioskTouchMode", 0);
+ if (val < 0 || val > 2) {
+ xf86Msg(X_WARNING, "%s: Invalid KioskTouchMode value: %d\n",
+ pInfo->name, val);
+ pEvdev->kioskTouch.mode = 0;
+ } else {
+ pEvdev->kioskTouch.mode = pEvdev->kioskTouch.mode_queued = val;
+ }
+ val = xf86SetIntOption(pInfo->options, "KioskTouchButton", 1);
+ if (val > 255) {
+ xf86Msg(X_WARNING, "%s: Invalid KioskTouchButton value: %d\n",
+ pInfo->name, val);
+ val = 0;
+ }
+ pEvdev->kioskTouch.button = pEvdev->kioskTouch.button_queued = val;
+ pEvdev->kioskTouch.state = 0;
+ xf86Msg(X_INFO, "%s: KioskTouchpad mode initialized to %s - button: %d\n",
+ pInfo->name, (pEvdev->kioskTouch.mode == 0) ? "disabled" :
+ (pEvdev->kioskTouch.mode == 1 ? "click-on-touch" : "click-on-release"),
+ pEvdev->kioskTouch.button);
+}
+
+static void
+EvdevKioskTouchSwitchQueued(EvdevPtr pEvdev)
+{
+ if (pEvdev->kioskTouch.mode != pEvdev->kioskTouch.mode_queued ||
+ pEvdev->kioskTouch.button != pEvdev->kioskTouch.button_queued) {
+ if (pEvdev->kioskTouch.state & KTOUCH_STATE_ACTIVE)
+ return;
+ if (pEvdev->mt_mask) {
+ int i;
+ for (i = 0; i < num_slots(pEvdev); i++) {
+ if (pEvdev->slots[i].dirty)
+ return;
+ }
+ }
+ pEvdev->kioskTouch.mode = pEvdev->kioskTouch.mode_queued;
+ pEvdev->kioskTouch.button = pEvdev->kioskTouch.button_queued;
+ }
+}
+
+BOOL
+EvdevKioskTouchFilterTouch(EvdevPtr pEvdev)
+{
+ EvdevKioskTouchSwitchQueued(pEvdev);
+ return (pEvdev->kioskTouch.mode > 0) ? TRUE : FALSE;
+}
+
+BOOL
+EvdevKioskTouchFilterButton(InputInfoPtr pInfo, unsigned int button, int value)
+{
+ EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
+
+ EvdevKioskTouchSwitchQueued(pEvdev);
+ if (button && button == pEvdev->kioskTouch.button) {
+ if (value == 1)
+ pEvdev->kioskTouch.state = KTOUCH_STATE_ACTIVE;
+ else
+ pEvdev->kioskTouch.state = 0;
+ switch (pEvdev->kioskTouch.mode) {
+ case 0:
+ DEBUG((ErrorF("%s: mode 1 button %d value %d\n", \
+ __func__, button, value)))
+ return FALSE;
+ case 1:
+ if (value == 1) {
+ DEBUG((ErrorF("%s: Sending ButtonDown/ButtonUp\n",__func__)))
+ EvdevQueueButtonClicks(pInfo, button, 1);
+ } else if (value == 0) {
+ pEvdev->kioskTouch.state = 0;
+ }
+ return TRUE;
+ case 2:
+ DEBUG((ErrorF("%s: mode 2 button %d value %d\n", \
+ __func__, button, value)))
+ if (value == 1)
+ return TRUE;
+ else if (value == 0) {
+ DEBUG((ErrorF("%s: Sending ButtonDown\n",__func__)))
+ EvdevQueueButtonEvent(pInfo, button, 1);
+ }
+ return FALSE;
+ default:
+ return FALSE;
+ }
+ }
+
+ return FALSE;
+}
+
+static int
+EvdevKioskTouchSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
+ BOOL checkonly)
+{
+ InputInfoPtr pInfo = dev->public.devicePrivate;
+ EvdevPtr pEvdev = pInfo->private;
+
+ if (atom == prop_ktouch)
+ {
+ if (val->format != 8 || val->size != 1 || val->type != XA_INTEGER)
+ return BadMatch;
+
+ if (!checkonly)
+ pEvdev->kioskTouch.mode_queued = *((unsigned char*)val->data);
+ } else if (atom == prop_ktouch_button) {
+
+ if (val->format != 8 || val->size != 1 || val->type != XA_INTEGER)
+ return BadMatch;
+
+ if (!checkonly)
+ pEvdev->kioskTouch.button_queued = *((unsigned char*)val->data);
+ }
+
+ return Success;
+}
+
+void
+EvdevKioskTouchInitProperty(DeviceIntPtr dev)
+{
+ InputInfoPtr pInfo = dev->public.devicePrivate;
+ EvdevPtr pEvdev = pInfo->private;
+ int rc;
+
+ if (pEvdev->mt_mask && !libevdev_has_event_code(pEvdev->dev, EV_KEY, BTN_TOUCH)) {
+ xf86Msg(X_WARNING, "%s: MultiTouch device has no BTN_TOUCH event: "
+ "no Kiosk Mode support\n", pInfo->name);
+ pEvdev->kioskTouch.mode = -1;
+ }
+
+ if (pEvdev->kioskTouch.mode < 0)
+ return;
+
+ prop_ktouch = MakeAtom(EVDEV_PROP_KIOSK_TOUCH, strlen(EVDEV_PROP_KIOSK_TOUCH), TRUE);
+ rc = XIChangeDeviceProperty(dev, prop_ktouch, XA_INTEGER, 8,
+ PropModeReplace, 1,
+ &pEvdev->kioskTouch.mode,
+ FALSE);
+ if (rc != Success)
+ return;
+ XISetDevicePropertyDeletable(dev, prop_ktouch, FALSE);
+
+ prop_ktouch_button = MakeAtom(EVDEV_PROP_KIOSK_BUTTON, strlen(EVDEV_PROP_KIOSK_BUTTON),
+ TRUE);
+ rc = XIChangeDeviceProperty(dev, prop_ktouch_button, XA_INTEGER, 8,
+ PropModeReplace, 1,
+ &pEvdev->kioskTouch.button,
+ FALSE);
+ if (rc != Success)
+ return;
+ XISetDevicePropertyDeletable(dev, prop_ktouch_button, FALSE);
+
+ XIRegisterPropertyHandler(dev, EvdevKioskTouchSetProperty, NULL, NULL);
+}
++++++ u_02-Add-delay-between-button-press-and-release-to-kiosk-mode.patch ++++++
From: Egbert Eich
Date: Mon Apr 18 23:26:25 2016 +0200
Subject: [PATCH 2/2]Add delay between button press and release to kiosk mode.
Patch-mainline: to be upstreamed
References: FATE#320263
Signed-off-by: Egbert Eich
This allows to notice the visual feedback of a UI on a button
press.
Signed-off-by: Egbert Eich
---
include/evdev-properties.h | 1 +
man/evdev.man | 15 ++++
src/evdev.c | 4 +
src/evdev.h | 11 ++-
src/kioskTouch.c | 201 ++++++++++++++++++++++++++++++++++++++++++---
5 files changed, 220 insertions(+), 12 deletions(-)
diff --git a/include/evdev-properties.h b/include/evdev-properties.h
index 29f2bd9..9f17b66 100644
--- a/include/evdev-properties.h
+++ b/include/evdev-properties.h
@@ -94,4 +94,5 @@
/* Kiosk Touch mode */
#define EVDEV_PROP_KIOSK_TOUCH "Evdev Kiosk Touch Mode"
#define EVDEV_PROP_KIOSK_BUTTON "Evdev Kiosk Touch Button"
+#define EVDEV_PROP_KIOSK_BUTTON_DELAY "Evdev Kiosk Touch Button Delay"
#endif
diff --git a/man/evdev.man b/man/evdev.man
index 404a88d..a9f67a0 100644
--- a/man/evdev.man
+++ b/man/evdev.man
@@ -258,6 +258,18 @@ Specifies the Kiosk Touch button number to use. Button
range: 0-255.
Default: "0". Property:
"Evdev Kiosk Touch Button".
+.TP 7
+.BI "Option \*qKioskTouchButtonDelay\*q \*q" "N" \*q
+Specifies the delay between a button press and release event in ms. A delay
+will help to notice a visual feedback on a button press event. During the
+delay no motion events are generated. Instead the final location is stored
+and a motion event to this location is sent after the button release has been
+sent at the end of the delay period.
+Button
+.I N
+range: 0-65535.
+Default: "0". Property:
+"Evdev Kiosk Touch Button Delay".
.SH SUPPORTED PROPERTIES
The following properties are provided by the
@@ -307,6 +319,9 @@ value.
.TP 7
.BI "Evdev Kiosk Touch Button"
1 8-bit positive value.
+.TP 7
+.BI "Evdev Kiosk Touch Button Delay"
+1 16-bit positive value.
.SH AUTHORS
Kristian Høgsberg, Peter Hutterer
diff --git a/src/evdev.c b/src/evdev.c
index 96d931f..5eaa5ce 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -482,6 +482,7 @@ EvdevProcessValuators(InputInfoPtr pInfo)
EvdevSwapAbsValuators(pEvdev, pEvdev->abs_vals);
EvdevApplyCalibration(pEvdev, pEvdev->abs_vals);
Evdev3BEmuProcessAbsMotion(pInfo, pEvdev->abs_vals);
+ EvdevKioskTouchMotionEvents(pInfo, pEvdev->abs_vals);
}
}
@@ -1966,6 +1967,7 @@ EvdevOn(DeviceIntPtr device)
xf86AddEnabledDevice(pInfo);
EvdevMBEmuOn(pInfo);
Evdev3BEmuOn(pInfo);
+ EvdevKioskTouchOn(pInfo);
pEvdev->flags |= EVDEV_INITIALIZED;
device->public.on = TRUE;
@@ -1995,6 +1997,7 @@ EvdevProc(DeviceIntPtr device, int what)
{
EvdevMBEmuFinalize(pInfo);
Evdev3BEmuFinalize(pInfo);
+ EvdevKioskTouchFinalize(pInfo);
}
if (pInfo->fd != -1)
{
@@ -2011,6 +2014,7 @@ EvdevProc(DeviceIntPtr device, int what)
xf86IDrvMsg(pInfo, X_INFO, "Close\n");
EvdevCloseDevice(pInfo);
EvdevFreeMasks(pEvdev);
+ EvdevKioskTouchClose(pInfo);
pEvdev->min_maj = 0;
break;
diff --git a/src/evdev.h b/src/evdev.h
index 27c1cb2..4a01e37 100644
--- a/src/evdev.h
+++ b/src/evdev.h
@@ -225,7 +225,12 @@ typedef struct {
/* 0: 0ff, 1: click on touch, 2: click on release */
unsigned int button_queued;
unsigned int button;
+ unsigned int delay;
+ unsigned int delay_queued;
unsigned int state;
+ int old_v[2];
+ ValuatorMask *vals;
+ Time expires;
} kioskTouch;
/* run-time calibration */
@@ -303,7 +308,11 @@ void EvdevAppleInitProperty(DeviceIntPtr);
/* Kiosk Touch */
void EvdevKioskTouchPreInit(InputInfoPtr pInfo);
-BOOL EvdevKioskTouchFilterButton(InputInfoPtr pInfo, unsigned int button, int value);
void EvdevKioskTouchInitProperty(DeviceIntPtr);
+BOOL EvdevKioskTouchFilterButton(InputInfoPtr pInfo, unsigned int button, int value);
BOOL EvdevKioskTouchFilterTouch(EvdevPtr pEvdev);
+void EvdevKioskTouchOn(InputInfoPtr pInfo);
+void EvdevKioskTouchFinalize(InputInfoPtr pInfo);
+void EvdevKioskTouchMotionEvents(InputInfoPtr pInfo, ValuatorMask *vals);
+void EvdevKioskTouchClose(InputInfoPtr pInfo);
#endif
diff --git a/src/kioskTouch.c b/src/kioskTouch.c
index 56acd8c..0e6de3a 100644
--- a/src/kioskTouch.c
+++ b/src/kioskTouch.c
@@ -42,8 +42,11 @@
static Atom prop_ktouch = 0; /* Kiosk touch emulation on/off property */
static Atom prop_ktouch_button = 0; /* Kiosk touch emulation button property */
+static Atom prop_ktouch_button_delay = 0; /* Kiosk touch emulation button delay property */
#define KTOUCH_STATE_ACTIVE 1U << 0
+#define KTOUCH_STATE_DELAY 1U << 1
+#define KTOUCH_STATE_DELAY_MOTION 1U << 2
void
EvdevKioskTouchPreInit(InputInfoPtr pInfo)
@@ -74,18 +77,21 @@ EvdevKioskTouchPreInit(InputInfoPtr pInfo)
val = 0;
}
pEvdev->kioskTouch.button = pEvdev->kioskTouch.button_queued = val;
+ val = xf86SetIntOption(pInfo->options, "KioskTouchButtonDelay", 0);
+ pEvdev->kioskTouch.delay = pEvdev->kioskTouch.delay_queued = val;
pEvdev->kioskTouch.state = 0;
- xf86Msg(X_INFO, "%s: KioskTouchpad mode initialized to %s - button: %d\n",
+ xf86Msg(X_INFO, "%s: KioskTouchpad mode initialized to %s - button: %d delay: %d\n",
pInfo->name, (pEvdev->kioskTouch.mode == 0) ? "disabled" :
(pEvdev->kioskTouch.mode == 1 ? "click-on-touch" : "click-on-release"),
- pEvdev->kioskTouch.button);
+ pEvdev->kioskTouch.button, pEvdev->kioskTouch.delay);
}
static void
EvdevKioskTouchSwitchQueued(EvdevPtr pEvdev)
{
if (pEvdev->kioskTouch.mode != pEvdev->kioskTouch.mode_queued ||
- pEvdev->kioskTouch.button != pEvdev->kioskTouch.button_queued) {
+ pEvdev->kioskTouch.button != pEvdev->kioskTouch.button_queued ||
+ pEvdev->kioskTouch.delay != pEvdev->kioskTouch.delay_queued) {
if (pEvdev->kioskTouch.state & KTOUCH_STATE_ACTIVE)
return;
if (pEvdev->mt_mask) {
@@ -97,6 +103,7 @@ EvdevKioskTouchSwitchQueued(EvdevPtr pEvdev)
}
pEvdev->kioskTouch.mode = pEvdev->kioskTouch.mode_queued;
pEvdev->kioskTouch.button = pEvdev->kioskTouch.button_queued;
+ pEvdev->kioskTouch.delay = pEvdev->kioskTouch.delay_queued;
}
}
@@ -107,6 +114,33 @@ EvdevKioskTouchFilterTouch(EvdevPtr pEvdev)
return (pEvdev->kioskTouch.mode > 0) ? TRUE : FALSE;
}
+static BOOL
+EvdevKioskTouchStopButtonTimer(InputInfoPtr pInfo, BOOL queue)
+{
+ EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
+
+ if ((pEvdev->kioskTouch.state & KTOUCH_STATE_DELAY) == 0)
+ return FALSE;
+
+ pEvdev->kioskTouch.state &= ~KTOUCH_STATE_DELAY;
+ if (queue) {
+ if (pEvdev->kioskTouch.state & KTOUCH_STATE_DELAY_MOTION) {
+ EvdevPostButtonEvent(pInfo, pEvdev->kioskTouch.button, BUTTON_RELEASE);
+ valuator_mask_copy(pEvdev->abs_vals, pEvdev->kioskTouch.vals);
+ valuator_mask_zero(pEvdev->kioskTouch.vals);
+ } else
+ EvdevQueueButtonEvent(pInfo, pEvdev->kioskTouch.button, 0);
+ } else {
+ EvdevPostButtonEvent(pInfo, pEvdev->kioskTouch.button, BUTTON_RELEASE);
+ if (pEvdev->kioskTouch.state & KTOUCH_STATE_DELAY_MOTION) {
+ xf86PostMotionEventM(pInfo->dev, Absolute, pEvdev->kioskTouch.vals);
+ valuator_mask_zero(pEvdev->kioskTouch.vals);
+ }
+ }
+ pEvdev->kioskTouch.state &= ~KTOUCH_STATE_DELAY_MOTION;
+ return TRUE;
+}
+
BOOL
EvdevKioskTouchFilterButton(InputInfoPtr pInfo, unsigned int button, int value)
{
@@ -117,28 +151,46 @@ EvdevKioskTouchFilterButton(InputInfoPtr pInfo, unsigned int button, int value)
if (value == 1)
pEvdev->kioskTouch.state = KTOUCH_STATE_ACTIVE;
else
- pEvdev->kioskTouch.state = 0;
+ pEvdev->kioskTouch.state &= ~KTOUCH_STATE_ACTIVE;
switch (pEvdev->kioskTouch.mode) {
case 0:
- DEBUG((ErrorF("%s: mode 1 button %d value %d\n", \
+ DEBUG((ErrorF("%s: mode 0 button %d value %d\n", \
__func__, button, value)))
return FALSE;
case 1:
if (value == 1) {
- DEBUG((ErrorF("%s: Sending ButtonDown/ButtonUp\n",__func__)))
- EvdevQueueButtonClicks(pInfo, button, 1);
+ DEBUG((ErrorF("%s: Sending ButtonDown\n",__func__)))
+ EvdevQueueButtonEvent(pInfo, button, 1);
+ if (pEvdev->kioskTouch.delay > 0) {
+ pEvdev->kioskTouch.state |= KTOUCH_STATE_DELAY;
+ pEvdev->kioskTouch.expires = GetTimeInMillis ()
+ + pEvdev->kioskTouch.delay;
+ } else {
+ DEBUG((ErrorF("%s: Sending ButtonUp\n",__func__)));
+ EvdevQueueButtonEvent(pInfo, button, 0);
+ }
} else if (value == 0) {
+ DEBUG((ErrorF("%s: EvdevKioskTouchFilterButton: Filter Button UP\n",__func__)));
+ if (pEvdev->kioskTouch.state & KTOUCH_STATE_DELAY)
+ EvdevKioskTouchStopButtonTimer(pInfo, TRUE);
pEvdev->kioskTouch.state = 0;
}
return TRUE;
case 2:
DEBUG((ErrorF("%s: mode 2 button %d value %d\n", \
- __func__, button, value)))
- if (value == 1)
+ __func__, button, value)));
+ if (value == 1) {
+ EvdevKioskTouchStopButtonTimer(pInfo, TRUE);
return TRUE;
- else if (value == 0) {
- DEBUG((ErrorF("%s: Sending ButtonDown\n",__func__)))
+ } else if (value == 0) {
EvdevQueueButtonEvent(pInfo, button, 1);
+ if (pEvdev->kioskTouch.delay > 0) {
+ pEvdev->kioskTouch.state |= KTOUCH_STATE_DELAY;
+ pEvdev->kioskTouch.expires = GetTimeInMillis ()
+ + pEvdev->kioskTouch.delay;
+ return TRUE;
+ } else
+ DEBUG((ErrorF("%s: Sending ButtonDown\n",__func__)));
}
return FALSE;
default:
@@ -149,6 +201,104 @@ EvdevKioskTouchFilterButton(InputInfoPtr pInfo, unsigned int button, int value)
return FALSE;
}
+void EvdevKioskTouchMotionEvents(InputInfoPtr pInfo, ValuatorMask *vals)
+{
+ EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
+
+ if (pEvdev->kioskTouch.mode == 1) {
+ int val;
+ if ((pEvdev->kioskTouch.state & KTOUCH_STATE_DELAY_MOTION) == 0) {
+ valuator_mask_fetch(vals, 0, &pEvdev->kioskTouch.old_v[0]);
+ valuator_mask_fetch(vals, 1, &pEvdev->kioskTouch.old_v[1]);
+ }
+ if (pEvdev->kioskTouch.state & KTOUCH_STATE_DELAY) {
+ if (valuator_mask_fetch(vals, 0, &val)) {
+ valuator_mask_set(pEvdev->kioskTouch.vals, 0, val);
+ valuator_mask_set(vals, 0, pEvdev->kioskTouch.old_v[0]);
+ }
+ if (valuator_mask_fetch(vals, 1, &val)) {
+ valuator_mask_set(pEvdev->kioskTouch.vals, 1, val);
+ valuator_mask_set(vals, 1, pEvdev->kioskTouch.old_v[1]);
+ }
+ pEvdev->kioskTouch.state |= KTOUCH_STATE_DELAY_MOTION;
+ } else {
+ valuator_mask_fetch(vals, 0, &pEvdev->kioskTouch.old_v[0]);
+ valuator_mask_fetch(vals, 1, &pEvdev->kioskTouch.old_v[1]);
+ }
+ }
+}
+
+static void
+EvdevKioskTouchWakeupHandler(pointer data,
+ int i,
+ pointer LastSelectMask)
+{
+ InputInfoPtr pInfo = (InputInfoPtr)data;
+ EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
+ int ms;
+
+ if (pEvdev->kioskTouch.state & KTOUCH_STATE_DELAY) {
+ ms = pEvdev->kioskTouch.expires - GetTimeInMillis();
+ if (ms <= 0) {
+ int sigstate;
+
+ sigstate = xf86BlockSIGIO ();
+ pEvdev->kioskTouch.state &= ~KTOUCH_STATE_DELAY;
+ DEBUG((ErrorF("Delayed ButtonUP\n")));
+ EvdevPostButtonEvent(pInfo, pEvdev->kioskTouch.button, BUTTON_RELEASE);
+ if (pEvdev->kioskTouch.state & KTOUCH_STATE_DELAY_MOTION) {
+ xf86PostMotionEventM(pInfo->dev, Absolute, pEvdev->kioskTouch.vals);
+ valuator_mask_zero(pEvdev->kioskTouch.vals);
+ pEvdev->kioskTouch.state &= ~KTOUCH_STATE_DELAY_MOTION;
+ }
+ xf86UnblockSIGIO (sigstate);
+ }
+ }
+}
+
+static void
+EvdevKioskTouchBlockHandler(pointer data,
+ struct timeval **waitTime,
+ pointer LastSelectMask)
+{
+ InputInfoPtr pInfo = (InputInfoPtr)data;
+ EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
+ int ms;
+
+ if (pEvdev->kioskTouch.state & KTOUCH_STATE_DELAY) {
+ ms = pEvdev->kioskTouch.expires - GetTimeInMillis ();
+ if (ms <= 0)
+ ms = 0;
+ AdjustWaitForDelay (waitTime, ms);
+ }
+}
+
+void
+EvdevKioskTouchOn(InputInfoPtr pInfo)
+{
+ EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
+
+ if (pEvdev->kioskTouch.mode == -1)
+ return;
+
+ RegisterBlockAndWakeupHandlers (EvdevKioskTouchBlockHandler,
+ EvdevKioskTouchWakeupHandler,
+ (pointer)pInfo);
+}
+
+void
+EvdevKioskTouchFinalize(InputInfoPtr pInfo)
+{
+ EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
+
+ if (pEvdev->kioskTouch.mode == -1)
+ return;
+
+ RemoveBlockAndWakeupHandlers (EvdevKioskTouchBlockHandler,
+ EvdevKioskTouchWakeupHandler,
+ (pointer)pInfo);
+}
+
static int
EvdevKioskTouchSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
BOOL checkonly)
@@ -170,6 +320,13 @@ EvdevKioskTouchSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
if (!checkonly)
pEvdev->kioskTouch.button_queued = *((unsigned char*)val->data);
+ } else if (atom == prop_ktouch_button_delay) {
+
+ if (val->format != 16 || val->size != 1 || val->type != XA_INTEGER)
+ return BadMatch;
+
+ if (!checkonly)
+ pEvdev->kioskTouch.delay_queued = *((CARD16*)val->data);
}
return Success;
@@ -182,10 +339,14 @@ EvdevKioskTouchInitProperty(DeviceIntPtr dev)
EvdevPtr pEvdev = pInfo->private;
int rc;
+ /* This doesn't really belong to property handling, however it is convenient to do
+ * here and avoids another function to be called */
if (pEvdev->mt_mask && !libevdev_has_event_code(pEvdev->dev, EV_KEY, BTN_TOUCH)) {
xf86Msg(X_WARNING, "%s: MultiTouch device has no BTN_TOUCH event: "
"no Kiosk Mode support\n", pInfo->name);
pEvdev->kioskTouch.mode = -1;
+ } else {
+ pEvdev->kioskTouch.vals = valuator_mask_new(2);
}
if (pEvdev->kioskTouch.mode < 0)
@@ -210,5 +371,23 @@ EvdevKioskTouchInitProperty(DeviceIntPtr dev)
return;
XISetDevicePropertyDeletable(dev, prop_ktouch_button, FALSE);
+ prop_ktouch_button_delay =
+ MakeAtom(EVDEV_PROP_KIOSK_BUTTON_DELAY, strlen(EVDEV_PROP_KIOSK_BUTTON_DELAY), TRUE);
+ rc = XIChangeDeviceProperty(dev, prop_ktouch_button_delay, XA_INTEGER, 16,
+ PropModeReplace, 1,
+ &pEvdev->kioskTouch.delay,
+ FALSE);
+ if (rc != Success)
+ return;
+ XISetDevicePropertyDeletable(dev, prop_ktouch_button_delay, FALSE);
+
XIRegisterPropertyHandler(dev, EvdevKioskTouchSetProperty, NULL, NULL);
}
+
+void
+EvdevKioskTouchClose(InputInfoPtr pInfo)
+{
+ EvdevPtr pEvdev = pInfo->private;
+
+ valuator_mask_free(&pEvdev->kioskTouch.vals);
+}
++++++ xf86-input-evdev-2.10.1.tar.bz2 -> xf86-input-evdev-2.10.2.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xf86-input-evdev-2.10.1/ChangeLog new/xf86-input-evdev-2.10.2/ChangeLog
--- old/xf86-input-evdev-2.10.1/ChangeLog 2016-01-08 06:13:11.000000000 +0100
+++ new/xf86-input-evdev-2.10.2/ChangeLog 2016-04-29 01:19:43.000000000 +0200
@@ -1,3 +1,83 @@
+commit f12eca9f8392934031cb250e7a2a5ed1d5ca11cf
+Author: Peter Hutterer
+Date: Fri Apr 29 09:13:35 2016 +1000
+
+ evdev 2.10.2
+
+ Signed-off-by: Peter Hutterer
+
+commit 33dc3d7128456d51b1fe6228096e6b714a3e900b
+Author: Peter Hutterer
+Date: Wed Apr 27 09:01:16 2016 +1000
+
+ Prevent buffer overrun accessing btn_labels
+
+ We go up to BTN_JOYSTICK, hence group can have a value of up to including 15.
+ The actual btn_labels only has 6 elements though.
+
+ Found by coverity.
+
+ Signed-off-by: Peter Hutterer
+
+commit 7b0a65d989117d1b071101221ff1b97c1b4d1946
+Author: Peter Hutterer
+Date: Fri Jan 15 14:01:02 2016 +1000
+
+ Don't reset the other axis on wheel emulation scroll buildup
+
+ The idea was that of a direction lock: as we move vertically we should not
+ build up any horizontal scroll motion even if we move slightly diagonally.
+
+ The effect was though that the axis would be reset completely as soon as an
+ event from the other axis occured. With the default threshold of 10, if one in
+ ten events was a REL_X, we'd never get a wheel event.
+
+ Drop this code, it's not needed. By default wheel emulation doesn't do
+ horizontal scrolling, if a config snippet sets XAxisMapping the user wants
+ horizontal scrolling. And since we just add the value anyway, as long as the
+ user does a roughly vertical motion we won't get over the threshold anyway.
+
+ https://bugs.freedesktop.org/show_bug.cgi?id=93617
+
+ Signed-off-by: Peter Hutterer
+
+commit d24431a1863c49aa9edcabf535ffa64bfa87053c
+Author: Peter Hutterer
+Date: Thu Jan 14 10:41:46 2016 +1000
+
+ Restore wheel emulation for absolute devices
+
+ Wheel emulation relies on oldVals, which stopped updating in 3dcf6f123c5.
+
+ Since wheel emulation may filter the abs event, store the event before we do
+ anything with it. If we really want the abs_event, abs_queued will be set to
+ 1, otherwise the value will be ignored.
+
+ And now that we know abs_value is always valied, we can copy its value into
+ old_vals, so that wheel emulation can calculate the delta correctly.
+
+ https://bugs.freedesktop.org/show_bug.cgi?id=93617
+
+ Signed-off-by: Peter Hutterer
+
+commit ce7d8fdebc0123227be91ba5d89126a36f089ff5
+Author: Peter Hutterer
+Date: Thu Jan 14 11:18:56 2016 +1000
+
+ man: add a warning that wheel emu inertia must be set and it isn't inertia
+
+ First, it's not actually inertia, it's simply the scroll distance, yay for the
+ misnomer.
+
+ And it needs to be set for any device that is more fine-grained than a
+ mouse, especially absolute devices. For example the VirtualBox device has an
+ abs max of 32767, so a simple motion may have a delta of to 2000 units and
+ that results in 200 scroll events. That's a bit excessive.
+
+ Related to: https://bugs.freedesktop.org/show_bug.cgi?id=93617
+
+ Signed-off-by: Peter Hutterer
+
commit 6a3beab6137b262fc847093ed5fa51ff70df6a21
Author: Peter Hutterer
Date: Fri Jan 8 15:11:59 2016 +1000
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xf86-input-evdev-2.10.1/aclocal.m4 new/xf86-input-evdev-2.10.2/aclocal.m4
--- old/xf86-input-evdev-2.10.1/aclocal.m4 2016-01-08 06:12:08.000000000 +0100
+++ new/xf86-input-evdev-2.10.2/aclocal.m4 2016-04-29 01:19:39.000000000 +0200
@@ -9052,32 +9052,63 @@
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
-# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-# serial 1 (pkg-config-0.24)
-#
-# Copyright © 2004 Scott James Remnant .
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------
+dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+dnl serial 11 (pkg-config-0.29)
+dnl
+dnl Copyright © 2004 Scott James Remnant .
+dnl Copyright © 2012-2015 Dan Nicholson
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
+
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+ [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
+])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
@@ -9099,18 +9130,19 @@
PKG_CONFIG=""
fi
fi[]dnl
-])# PKG_PROG_PKG_CONFIG
+])dnl PKG_PROG_PKG_CONFIG
-# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-#
-# Check to see whether a particular set of modules exists. Similar
-# to PKG_CHECK_MODULES(), but does not set variables or print errors.
-#
-# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-# only at the first occurence in configure.ac, so if the first place
-# it's called might be skipped (such as if it is within an "if", you
-# have to call PKG_CHECK_EXISTS manually
-# --------------------------------------------------------------
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
@@ -9120,8 +9152,10 @@
$3])dnl
fi])
-# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-# ---------------------------------------------
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
@@ -9133,10 +9167,11 @@
else
pkg_failed=untried
fi[]dnl
-])# _PKG_CONFIG
+])dnl _PKG_CONFIG
-# _PKG_SHORT_ERRORS_SUPPORTED
-# -----------------------------
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -9144,19 +9179,17 @@
else
_pkg_short_errors_supported=no
fi[]dnl
-])# _PKG_SHORT_ERRORS_SUPPORTED
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
-# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-# [ACTION-IF-NOT-FOUND])
-#
-#
-# Note that if there is a possibility the first call to
-# PKG_CHECK_MODULES might not happen, you should be sure to include an
-# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
-#
-#
-# --------------------------------------------------------------
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
@@ -9210,16 +9243,40 @@
AC_MSG_RESULT([yes])
$3
fi[]dnl
-])# PKG_CHECK_MODULES
+])dnl PKG_CHECK_MODULES
+
+
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
-# PKG_INSTALLDIR(DIRECTORY)
-# -------------------------
-# Substitutes the variable pkgconfigdir as the location where a module
-# should install pkg-config .pc files. By default the directory is
-# $libdir/pkgconfig, but the default can be changed by passing
-# DIRECTORY. The user can override through the --with-pkgconfigdir
-# parameter.
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
AC_DEFUN([PKG_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
m4_pushdef([pkg_description],
@@ -9230,16 +9287,18 @@
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
-]) dnl PKG_INSTALLDIR
+])dnl PKG_INSTALLDIR
-# PKG_NOARCH_INSTALLDIR(DIRECTORY)
-# -------------------------
-# Substitutes the variable noarch_pkgconfigdir as the location where a
-# module should install arch-independent pkg-config .pc files. By
-# default the directory is $datadir/pkgconfig, but the default can be
-# changed by passing DIRECTORY. The user can override through the
-# --with-noarch-pkgconfigdir parameter.
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
m4_pushdef([pkg_description],
@@ -9250,13 +9309,15 @@
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
-]) dnl PKG_NOARCH_INSTALLDIR
+])dnl PKG_NOARCH_INSTALLDIR
-# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
-# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-# -------------------------------------------
-# Retrieves the value of the pkg-config variable for the given module.
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
@@ -9265,7 +9326,7 @@
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
-])# PKG_CHECK_VAR
+])dnl PKG_CHECK_VAR
dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure.
dnl
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xf86-input-evdev-2.10.1/configure new/xf86-input-evdev-2.10.2/configure
--- old/xf86-input-evdev-2.10.1/configure 2016-01-08 06:12:09.000000000 +0100
+++ new/xf86-input-evdev-2.10.2/configure 2016-04-29 01:19:40.000000000 +0200
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for xf86-input-evdev 2.10.1.
+# Generated by GNU Autoconf 2.69 for xf86-input-evdev 2.10.2.
#
# Report bugs to https://bugs.freedesktop.org/enter_bug.cgi?product=xorg.
#
@@ -591,8 +591,8 @@
# Identity of this package.
PACKAGE_NAME='xf86-input-evdev'
PACKAGE_TARNAME='xf86-input-evdev'
-PACKAGE_VERSION='2.10.1'
-PACKAGE_STRING='xf86-input-evdev 2.10.1'
+PACKAGE_VERSION='2.10.2'
+PACKAGE_STRING='xf86-input-evdev 2.10.2'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
PACKAGE_URL=''
@@ -1364,7 +1364,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures xf86-input-evdev 2.10.1 to adapt to many kinds of systems.
+\`configure' configures xf86-input-evdev 2.10.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1435,7 +1435,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of xf86-input-evdev 2.10.1:";;
+ short | recursive ) echo "Configuration of xf86-input-evdev 2.10.2:";;
esac
cat <<\_ACEOF
@@ -1574,7 +1574,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-xf86-input-evdev configure 2.10.1
+xf86-input-evdev configure 2.10.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1898,7 +1898,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by xf86-input-evdev $as_me 2.10.1, which was
+It was created by xf86-input-evdev $as_me 2.10.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2766,7 +2766,7 @@
# Define the identity of the package.
PACKAGE='xf86-input-evdev'
- VERSION='2.10.1'
+ VERSION='2.10.2'
cat >>confdefs.h <<_ACEOF
@@ -19227,7 +19227,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by xf86-input-evdev $as_me 2.10.1, which was
+This file was extended by xf86-input-evdev $as_me 2.10.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -19293,7 +19293,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-xf86-input-evdev config.status 2.10.1
+xf86-input-evdev config.status 2.10.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xf86-input-evdev-2.10.1/configure.ac new/xf86-input-evdev-2.10.2/configure.ac
--- old/xf86-input-evdev-2.10.1/configure.ac 2016-01-08 06:11:57.000000000 +0100
+++ new/xf86-input-evdev-2.10.2/configure.ac 2016-04-29 01:12:17.000000000 +0200
@@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-input-evdev],
- [2.10.1],
+ [2.10.2],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-input-evdev])
AC_CONFIG_SRCDIR([Makefile.am])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xf86-input-evdev-2.10.1/man/evdev.man new/xf86-input-evdev-2.10.2/man/evdev.man
--- old/xf86-input-evdev-2.10.1/man/evdev.man 2015-12-03 05:40:25.000000000 +0100
+++ new/xf86-input-evdev-2.10.2/man/evdev.man 2016-01-18 03:03:49.000000000 +0100
@@ -125,6 +125,19 @@
Specifies how far (in pixels) the pointer must move to generate button
press/release events in wheel emulation mode. Default: 10. Property: "Evdev
Wheel Emulation Inertia".
+.IP
+This value must be set for any device does not resemble a standard mouse.
+Specifically, on absolute devices such as tablets the value should be set to
+a reasonable fraction of the expected movement to avoid excess scroll events.
+.IP
+.B WARNING:
+the name \*qinertia\*q is a misnomer. This option defines the distance
+required to generate one scroll event similar to the
+.B VertScrollDelta
+and
+.B HorizScrollDelta
+options. It does not enable inertia in the
+physical sense, scrolling stops immediately once the movement has stopped.
.TP 7
.BI "Option \*qEmulateWheelTimeout\*q \*q" integer \*q
Specifies the time in milliseconds the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xf86-input-evdev-2.10.1/src/emuWheel.c new/xf86-input-evdev-2.10.2/src/emuWheel.c
--- old/xf86-input-evdev-2.10.1/src/emuWheel.c 2015-12-03 05:40:25.000000000 +0100
+++ new/xf86-input-evdev-2.10.2/src/emuWheel.c 2016-01-20 01:48:36.000000000 +0100
@@ -95,7 +95,7 @@
EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
{
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
- WheelAxisPtr pAxis = NULL, pOtherAxis = NULL;
+ WheelAxisPtr pAxis = NULL;
int value = pEv->value;
/* Has wheel emulation been configured to be enabled? */
@@ -130,13 +130,11 @@
/* ABS_X has the same value as REL_X, so this case catches both */
case REL_X:
pAxis = &(pEvdev->emulateWheel.X);
- pOtherAxis = &(pEvdev->emulateWheel.Y);
break;
/* ABS_Y has the same value as REL_Y, so this case catches both */
case REL_Y:
pAxis = &(pEvdev->emulateWheel.Y);
- pOtherAxis = &(pEvdev->emulateWheel.X);
break;
default:
@@ -144,15 +142,10 @@
}
/* If we found REL_X, REL_Y, ABS_X or ABS_Y then emulate a mouse
- wheel. Reset the inertia of the other axis when a scroll event
- was sent to avoid the buildup of erroneous scroll events if the
- user doesn't move in a perfectly straight line.
+ wheel.
*/
if (pAxis)
- {
- if (EvdevWheelEmuInertia(pInfo, pAxis, value))
- pOtherAxis->traveled_distance = 0;
- }
+ EvdevWheelEmuInertia(pInfo, pAxis, value);
/* Eat motion events while emulateWheel button pressed. */
return TRUE;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/xf86-input-evdev-2.10.1/src/evdev.c new/xf86-input-evdev-2.10.2/src/evdev.c
--- old/xf86-input-evdev-2.10.1/src/evdev.c 2015-12-15 04:20:44.000000000 +0100
+++ new/xf86-input-evdev-2.10.2/src/evdev.c 2016-04-27 01:10:46.000000000 +0200
@@ -430,6 +430,14 @@
EvdevProcessValuators(InputInfoPtr pInfo)
{
EvdevPtr pEvdev = pInfo->private;
+ int val;
+
+ if (pEvdev->abs_vals) {
+ if (valuator_mask_fetch(pEvdev->abs_vals, 0, &val))
+ valuator_mask_set(pEvdev->old_vals, 0, val);
+ if (valuator_mask_fetch(pEvdev->abs_vals, 1, &val))
+ valuator_mask_set(pEvdev->old_vals, 1, val);
+ }
/* Apply transformations on relative coordinates */
if (pEvdev->rel_queued) {
@@ -765,6 +773,12 @@
if (ev->code > ABS_MAX)
return;
+ /* Always store the current abs valuator, we need it to update old_vals
+ * which is required by wheel emulation */
+ map = pEvdev->abs_axis_map[ev->code];
+ if (map < 2)
+ valuator_mask_set(pEvdev->abs_vals, map, value);
+
if (EvdevWheelEmuFilterMotion(pInfo, ev))
return;
@@ -781,10 +795,7 @@
valuator_mask_set(pEvdev->rel_vals, map, value - oldval);
pEvdev->rel_queued = 1;
}
- valuator_mask_set(pEvdev->old_vals, map, value);
} else {
- /* the normal case: just store the number. */
- valuator_mask_set(pEvdev->abs_vals, map, value);
pEvdev->abs_queued = 1;
}
}
@@ -2779,6 +2790,9 @@
int group = (button % 0x100)/16;
int idx = button - ((button/16) * 16);
+ if (group >= ArrayLength(btn_labels))
+ break;
+
if (!libevdev_has_event_code(pEvdev->dev, EV_KEY, button))
continue;