[gnome-control-center/gnome-2-32] mouse: Enable 2-finger scrolling through emulation



commit 4df1925faa0f1b84f3250ae44a7d1f8edf4fa948
Author: Chris Bagwell <chris cnpbagwell com>
Date:   Mon Nov 1 11:28:22 2010 +0000

    mouse: Enable 2-finger scrolling through emulation
    
    Also enable 2-finger scrolling if the device supports reporting
    finger-width, not only when it supports actual 2-finger scrolling.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=625163

 capplets/mouse/gnome-mouse-properties.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/capplets/mouse/gnome-mouse-properties.c b/capplets/mouse/gnome-mouse-properties.c
index 041ef58..8f230f7 100644
--- a/capplets/mouse/gnome-mouse-properties.c
+++ b/capplets/mouse/gnome-mouse-properties.c
@@ -357,14 +357,16 @@ synaptics_check_capabilities (GtkBuilder *dialog)
 		if ((XGetDeviceProperty (GDK_DISPLAY (), device, prop, 0, 2, False,
 					 XA_INTEGER, &realtype, &realformat, &nitems,
 					 &bytes_after, &data) == Success) && (realtype != None)) {
-			/* Property data is booleans for has_left, has_middle,
-			 * has_right, has_double, has_triple */
+			/* Property data is booleans for has_left, has_middle, has_right, has_double, has_triple.
+			 * Newer drivers (X.org/kerrnel) will also include has_pressure and has_width. */
 			if (!data[0]) {
 				gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("tap_to_click_toggle")), TRUE);
 				gtk_widget_set_sensitive (WID ("tap_to_click_toggle"), FALSE);
 			}
 
-			if (!data[3])
+			/* Disable two finger scrolling unless the hardware supports
+			 * double touch or can emulate it based on finger width. */
+			if (!(data[3] ||(nitems >= 6 && data[5])))
 				gtk_widget_set_sensitive (WID ("scroll_twofinger_radio"), FALSE);
 
 			XFree (data);



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