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



commit 109b36919921d757b93b91e8082620078608967e
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

 panels/mouse/gnome-mouse-properties.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/panels/mouse/gnome-mouse-properties.c b/panels/mouse/gnome-mouse-properties.c
index 28fc1be..356f984 100644
--- a/panels/mouse/gnome-mouse-properties.c
+++ b/panels/mouse/gnome-mouse-properties.c
@@ -227,14 +227,16 @@ synaptics_check_capabilities (GtkBuilder *dialog)
 		if ((XGetDeviceProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), 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]