[gnome-control-center] mouse: Don't allow two-finger and edge scrolling at the same time



commit 61e00d01726148e76ec5a0a4a9df4f27cb611f54
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jun 30 13:42:28 2016 +0200

    mouse: Don't allow two-finger and edge scrolling at the same time
    
    As done when changing the setting manually.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=761461

 panels/mouse/gnome-mouse-properties.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/panels/mouse/gnome-mouse-properties.c b/panels/mouse/gnome-mouse-properties.c
index a64bb68..9fd8c1a 100644
--- a/panels/mouse/gnome-mouse-properties.c
+++ b/panels/mouse/gnome-mouse-properties.c
@@ -99,10 +99,18 @@ setup_touchpad_options (CcMousePropertiesPrivate *d)
 
        edge_scroll_enabled = g_settings_get_boolean (d->touchpad_settings, "edge-scrolling-enabled");
        two_finger_scroll_enabled = g_settings_get_boolean (d->touchpad_settings, 
"two-finger-scrolling-enabled");
-       d->changing_scroll = TRUE;
-       gtk_switch_set_active (GTK_SWITCH (WID ("edge-scrolling-switch")), edge_scroll_enabled);
-       gtk_switch_set_active (GTK_SWITCH (WID ("two-finger-scrolling-switch")), two_finger_scroll_enabled);
-       d->changing_scroll = FALSE;
+       if (edge_scroll_enabled && two_finger_scroll_enabled) {
+               /* You cunning user set both, but you can only have one set in that UI */
+               d->changing_scroll = TRUE;
+               gtk_switch_set_active (GTK_SWITCH (WID ("two-finger-scrolling-switch")), 
two_finger_scroll_enabled);
+               d->changing_scroll = FALSE;
+               gtk_switch_set_active (GTK_SWITCH (WID ("edge-scrolling-switch")), FALSE);
+       } else {
+               d->changing_scroll = TRUE;
+               gtk_switch_set_active (GTK_SWITCH (WID ("edge-scrolling-switch")), edge_scroll_enabled);
+               gtk_switch_set_active (GTK_SWITCH (WID ("two-finger-scrolling-switch")), 
two_finger_scroll_enabled);
+               d->changing_scroll = FALSE;
+       }
 }
 
 static void


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