[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#491165: new patch



Sorry wrong mail and unusable file in patch :(
From: Fedor P. Goncharov <fedgo@gorodok.net>

Some touchpads have a scroll wheel region where a very large X coordinate.
Default diver only  eliminate discontinuity and ignoring scroll functionality (user
can't activate scrolling on this area, instead they mast add some normal area and use
it for start scrolling). This patch add autodetection such region.

---

diff -purN xfree86-driver-synaptics-0.14.7~git20070706/manpages/synaptics.5 xfree86-driver-synaptics-0.14.7~git20070706.BAK/manpages/synaptics.5
--- xfree86-driver-synaptics-0.14.7~git20070706/manpages/synaptics.5	2007-09-17 13:31:24.000000000 +0700
+++ xfree86-driver-synaptics-0.14.7~git20070706.BAK/manpages/synaptics.5	2008-07-17 15:14:35.000000000 +0700
@@ -91,6 +91,11 @@ X coordinate for left edge.
 \fBRightEdge\fR (Integer)
 X coordinate for right edge.
 .TP
+\fBSpecialScrollAreaRight\fR (Bool)
+Detect special scroll wheel region and set coordinate automaticly (region
+must have a very large X  coordinate). Disable option if you didn't want use
+it region.
+.TP
 \fBTopEdge\fR (Integer)
 Y coordinate for top edge.
 .TP
diff -purN xfree86-driver-synaptics-0.14.7~git20070706/synaptics.c xfree86-driver-synaptics-0.14.7~git20070706.BAK/synaptics.c
--- xfree86-driver-synaptics-0.14.7~git20070706/synaptics.c	2007-09-17 13:31:24.000000000 +0700
+++ xfree86-driver-synaptics-0.14.7~git20070706.BAK/synaptics.c	2008-07-17 16:09:54.000000000 +0700
@@ -1,4 +1,7 @@
 /*
+ *   Copyright 2008 Fedor P. Goncharov <fedgo@gorodok.net>
+ *     patch for right wheel region detection
+ *
  *   Copyright 2007 Joseph P. Skudlarek <Jskud@Jskud.com>
  *     patch for corner coasting (originally called corner edge scrolling)
  *
@@ -430,6 +433,7 @@ SynapticsPreInit(InputDriverPtr drv, IDe
 							      "EmulateMidButtonTime", 75);
     pars->emulate_twofinger_z = xf86SetIntOption(opts, "EmulateTwoFingerMinZ", 257);
     pars->scroll_edge_vert = xf86SetBoolOption(opts, "VertEdgeScroll", TRUE);
+    pars->special_scroll_area_right  = xf86SetBoolOption(opts, "SpecialScrollAreaRight", TRUE);
     pars->scroll_edge_horiz = xf86SetBoolOption(opts, "HorizEdgeScroll", TRUE);
     pars->scroll_edge_corner = xf86SetBoolOption(opts, "CornerCoasting", FALSE);
     pars->scroll_twofinger_vert = xf86SetBoolOption(opts, "VertTwoFingerScroll", FALSE);
@@ -777,7 +781,7 @@ edge_detection(SynapticsPrivate *priv, i
     if (priv->synpara->circular_pad)
 	return circular_edge_detection(priv, x, y);
 
-    if (x > priv->synpara->right_edge)
+    if (x >= priv->synpara->right_edge)
 	edge |= RIGHT_EDGE;
     else if (x < priv->synpara->left_edge)
 	edge |= LEFT_EDGE;
@@ -1820,14 +1824,27 @@ HandleState(LocalDevicePtr local, struct
 
     /*
      * Some touchpads have a scroll wheel region where a very large X
-     * coordinate is reported. For such touchpads, we adjust the X
-     * coordinate to eliminate the discontinuity.
+     * coordinate is reported. We suggest two  solution this problem.
      */
     if (hw->x <= XMAX_VALID) {
 	if (priv->largest_valid_x < hw->x)
 	    priv->largest_valid_x = hw->x;
     } else {
-	hw->x = priv->largest_valid_x;
+      if (!(para->special_scroll_area_right))
+	/*               First (default):
+	 * adjust the X coordinate to eliminate the discontinuity and use it as
+	 * line with 1 coordinate size.
+	 */
+	hw->x = priv->largest_valid_x + 1;
+      else {
+	/*               Second:
+	 * Adjust the X coordinate to eliminate the discontinuity
+	 * and use it as scroll area automaticly.
+	 */	
+	hw->x = priv->largest_valid_x + 1;
+	priv->synpara->right_edge=priv->largest_valid_x + 1;
+	para->special_scroll_area_right = FALSE;
+      }
     }
 
     edge = edge_detection(priv, hw->x, hw->y);
diff -purN xfree86-driver-synaptics-0.14.7~git20070706/synaptics.h xfree86-driver-synaptics-0.14.7~git20070706.BAK/synaptics.h
--- xfree86-driver-synaptics-0.14.7~git20070706/synaptics.h	2007-09-17 13:31:24.000000000 +0700
+++ xfree86-driver-synaptics-0.14.7~git20070706.BAK/synaptics.h	2008-07-17 12:17:01.000000000 +0700
@@ -67,6 +67,7 @@ typedef struct _SynapticsSHM
     Bool scroll_edge_corner;		    /* Enable/disable continuous edge scrolling when in the corner */
     Bool scroll_twofinger_vert;		    /* Enable/disable vertical two-finger scrolling */
     Bool scroll_twofinger_horiz;	    /* Enable/disable horizontal two-finger scrolling */
+    Bool special_scroll_area_right;         /* Enable/disable autodetection right special scroll area */
     double min_speed, max_speed, accl;	    /* movement parameters */
     double trackstick_speed;		    /* trackstick mode speed */
     int edge_motion_min_z;		    /* finger pressure at which minimum edge motion speed is set */

Reply to: