Re: [Linuxwacom-devel] [RFC PATCH 9/9]: Always allow single finger gestures

2012-10-02 Thread Chris Bagwell
On Sat, Sep 29, 2012 at 6:58 PM, Jason Gerecke killert...@gmail.com wrote:
 At the moment, disabling gestures disables *all* gestures. That includes
 the core tap to click gesture (and slightly-less-core tap and hold to
 drag). This patch changes the behavior of the driver to always allow
 single finger gestures, even if gestures have been disabled. This makes
 using the tablet a bit more user friendly when gestures have been disabled
 to allow multitouch to be handled outside of the driver.
 ---
 This patch has been marked RFC since I'm not sure if this is how we want
 the driver to act or not. Having touch enabled without tap to click is
 pretty useless IMHO, but I don't want to push this without getting an idea
 of possible ways it could backfire.

We shipped many a versions where touchscreen touch was enabled
regardless of Gesture enable.  I was the one that changed it when I
centralized the touchscreen specific logic in wcmUsb and wcmISDV4 to
wcmTouchFilter so they wouldn't be fiting against each other.

I guess the change in behavior was I was being one part lazy and one
part not sure how XI2.2 was going to work and I thought there was
reasonable chance it would require us to stop sending all button
presses.

I think this patch is good idea and if issue arise we can add a
touchscreen specific touch disable property.

Acked-by: Chris Bagwell ch...@cnpbagwell.com


  man/wacom.man|  6 +++---
  src/wcmTouchFilter.c | 17 +++--
  2 files changed, 14 insertions(+), 9 deletions(-)

 diff --git a/man/wacom.man b/man/wacom.man
 index 4438cc5..c14a3d6 100644
 --- a/man/wacom.man
 +++ b/man/wacom.man
 @@ -232,9 +232,9 @@ The threshold applies to the normalised pressure range of 
 [0..2048].
  The default is 27.
  .TP 4
  .B Option \fIGesture\fP \fIbool\fP
 -Enable or disable in-driver gesture support on the device. Default: off 
 unless the
 -tablet supports multi-touch. Note that disabling this option may allow the 
 desktop
 -environment to detect gestures instead.
 +Enable or disable multi-finger in-driver gesture support on the device. 
 Default: off
 +unless the tablet supports multi-touch. Note that disabling this option may 
 allow
 +the desktop environment to detect multi-finger gestures instead.
  .TP 4
  .B Option \fIZoomDistance\fP \fInumber\fP
  If
 diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c
 index b859973..49658ea 100644
 --- a/src/wcmTouchFilter.c
 +++ b/src/wcmTouchFilter.c
 @@ -250,6 +250,9 @@ static void wcmFingerTapToClick(WacomDevicePtr priv)
 WacomCommonPtr common = priv-common;
 WacomDeviceState ds[2] = {{0}}, dsLast[2] = {{0}};

 +   if (!common-wcmGesture)
 +   return;
 +
 getStateHistory(common, ds, ARRAY_SIZE(ds), 0);
 getStateHistory(common, dsLast, ARRAY_SIZE(dsLast), 1);

 @@ -379,7 +382,7 @@ void wcmGestureFilter(WacomDevicePtr priv, int touch_id)
 return;
 }

 -   if (!common-wcmGesture)
 +   if (common-wcmGestureMode == GESTURE_MULTITOUCH_MODE)
 goto ret;

 /* When 2 fingers are in proximity, it must always be in one of
 @@ -526,11 +529,7 @@ ret:

 if (common-wcmGestureMode == GESTURE_NONE_MODE  touch_id == 0)
 {
 -   /* Since this is in ret block, can not rely on generic
 -* wcmGesture enable check from above.
 -*/
 -   if (common-wcmGesture)
 -   wcmSingleFingerTap(priv);
 +   wcmSingleFingerTap(priv);
 wcmSingleFingerPress(priv);
 }
  }
 @@ -575,6 +574,9 @@ static void wcmFingerScroll(WacomDevicePtr priv)
 WacomFilterState filterd;  /* borrow this struct */
 int max_spread = 
 common-wcmGestureParameters.wcmMaxScrollFingerSpread;

 +   if (!common-wcmGesture)
 +   return;
 +
 getStateHistory(common, ds, ARRAY_SIZE(ds), 0);

 DBG(10, priv, \n);
 @@ -672,6 +674,9 @@ static void wcmFingerZoom(WacomDevicePtr priv)
 common-wcmGestureState[1]);
 int max_spread = 
 common-wcmGestureParameters.wcmMaxScrollFingerSpread;

 +   if (!common-wcmGesture)
 +   return;
 +
 getStateHistory(common, ds, ARRAY_SIZE(ds), 0);

 DBG(10, priv, \n);
 --
 1.7.12


 --
 How fast is your code?
 3 out of 4 devs don\\\'t know how their code performs in production.
 Find out how slow your code is with AppDynamics Lite.
 http://ad.doubleclick.net/clk;262219672;13503038;z?
 http://info.appdynamics.com/FreeJavaPerformanceDownload.html
 ___
 Linuxwacom-devel mailing list
 Linuxwacom-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

--
Don't let slow site performance ruin your business. Deploy New Relic APM

[Linuxwacom-devel] [RFC PATCH 9/9]: Always allow single finger gestures

2012-09-29 Thread Jason Gerecke
At the moment, disabling gestures disables *all* gestures. That includes
the core tap to click gesture (and slightly-less-core tap and hold to
drag). This patch changes the behavior of the driver to always allow
single finger gestures, even if gestures have been disabled. This makes
using the tablet a bit more user friendly when gestures have been disabled
to allow multitouch to be handled outside of the driver.
---
This patch has been marked RFC since I'm not sure if this is how we want
the driver to act or not. Having touch enabled without tap to click is
pretty useless IMHO, but I don't want to push this without getting an idea
of possible ways it could backfire.

 man/wacom.man|  6 +++---
 src/wcmTouchFilter.c | 17 +++--
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/man/wacom.man b/man/wacom.man
index 4438cc5..c14a3d6 100644
--- a/man/wacom.man
+++ b/man/wacom.man
@@ -232,9 +232,9 @@ The threshold applies to the normalised pressure range of 
[0..2048].
 The default is 27.
 .TP 4
 .B Option \fIGesture\fP \fIbool\fP
-Enable or disable in-driver gesture support on the device. Default: off unless 
the
-tablet supports multi-touch. Note that disabling this option may allow the 
desktop
-environment to detect gestures instead.
+Enable or disable multi-finger in-driver gesture support on the device. 
Default: off
+unless the tablet supports multi-touch. Note that disabling this option may 
allow
+the desktop environment to detect multi-finger gestures instead.
 .TP 4
 .B Option \fIZoomDistance\fP \fInumber\fP
 If
diff --git a/src/wcmTouchFilter.c b/src/wcmTouchFilter.c
index b859973..49658ea 100644
--- a/src/wcmTouchFilter.c
+++ b/src/wcmTouchFilter.c
@@ -250,6 +250,9 @@ static void wcmFingerTapToClick(WacomDevicePtr priv)
WacomCommonPtr common = priv-common;
WacomDeviceState ds[2] = {{0}}, dsLast[2] = {{0}};
 
+   if (!common-wcmGesture)
+   return;
+
getStateHistory(common, ds, ARRAY_SIZE(ds), 0);
getStateHistory(common, dsLast, ARRAY_SIZE(dsLast), 1);
 
@@ -379,7 +382,7 @@ void wcmGestureFilter(WacomDevicePtr priv, int touch_id)
return;
}
 
-   if (!common-wcmGesture)
+   if (common-wcmGestureMode == GESTURE_MULTITOUCH_MODE)
goto ret;
 
/* When 2 fingers are in proximity, it must always be in one of
@@ -526,11 +529,7 @@ ret:
 
if (common-wcmGestureMode == GESTURE_NONE_MODE  touch_id == 0)
{
-   /* Since this is in ret block, can not rely on generic
-* wcmGesture enable check from above.
-*/
-   if (common-wcmGesture)
-   wcmSingleFingerTap(priv);
+   wcmSingleFingerTap(priv);
wcmSingleFingerPress(priv);
}
 }
@@ -575,6 +574,9 @@ static void wcmFingerScroll(WacomDevicePtr priv)
WacomFilterState filterd;  /* borrow this struct */
int max_spread = common-wcmGestureParameters.wcmMaxScrollFingerSpread;
 
+   if (!common-wcmGesture)
+   return;
+
getStateHistory(common, ds, ARRAY_SIZE(ds), 0);
 
DBG(10, priv, \n);
@@ -672,6 +674,9 @@ static void wcmFingerZoom(WacomDevicePtr priv)
common-wcmGestureState[1]);
int max_spread = common-wcmGestureParameters.wcmMaxScrollFingerSpread;
 
+   if (!common-wcmGesture)
+   return;
+
getStateHistory(common, ds, ARRAY_SIZE(ds), 0);
 
DBG(10, priv, \n);
-- 
1.7.12


--
How fast is your code?
3 out of 4 devs don\\\'t know how their code performs in production.
Find out how slow your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219672;13503038;z?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel