From f6f179c4ad0494aa0fa65ea9c2ba68fd99713a4d Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Thu, 3 Mar 2016 12:31:10 +0000 Subject: Touchpad settings: Support edge and two-finger scrolling independently --- capplets/mouse/mate-mouse-properties.c | 76 +------- capplets/mouse/mate-mouse-properties.ui | 299 +++++++++++++++++++------------- 2 files changed, 182 insertions(+), 193 deletions(-) (limited to 'capplets/mouse') diff --git a/capplets/mouse/mate-mouse-properties.c b/capplets/mouse/mate-mouse-properties.c index 88555d3b..0a6fb88d 100644 --- a/capplets/mouse/mate-mouse-properties.c +++ b/capplets/mouse/mate-mouse-properties.c @@ -201,53 +201,6 @@ orientation_radio_button_toggled (GtkToggleButton *togglebutton, g_settings_set_boolean (mouse_settings, "left-handed", left_handed); } -static void -scrollmethod_gsettings_changed_event (GSettings *settings, - gchar *key, - GtkBuilder *dialog) -{ - int scroll_method = g_settings_get_int (touchpad_settings, "scroll-method"); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("scroll_disabled_radio")), - scroll_method == 0); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("scroll_edge_radio")), - scroll_method == 1); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("scroll_twofinger_radio")), - scroll_method == 2); - gtk_widget_set_sensitive (WID ("horiz_scroll_toggle"), - scroll_method != 0); - gtk_widget_set_sensitive (WID ("natural_scroll_toggle"), - scroll_method != 0); -} - -static void -scrollmethod_clicked_event (GtkWidget *widget, - GtkBuilder *dialog) -{ - GtkToggleButton *disabled = GTK_TOGGLE_BUTTON (WID ("scroll_disabled_radio")); - - gtk_widget_set_sensitive (WID ("horiz_scroll_toggle"), - !gtk_toggle_button_get_active (disabled)); - - gtk_widget_set_sensitive (WID ("natural_scroll_toggle"), - !gtk_toggle_button_get_active (disabled)); - - GSList *radio_group; - int new_scroll_method; - int old_scroll_method = g_settings_get_int (touchpad_settings, "scroll-method"); - - if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(widget))) - return; - - radio_group = g_slist_copy (gtk_radio_button_get_group - (GTK_RADIO_BUTTON (WID ("scroll_disabled_radio")))); - radio_group = g_slist_reverse (radio_group); - new_scroll_method = g_slist_index (radio_group, widget); - g_slist_free (radio_group); - - if (new_scroll_method != old_scroll_method) - g_settings_set_int (touchpad_settings, "scroll-method", new_scroll_method); -} - static void synaptics_check_capabilities (GtkBuilder *dialog) { @@ -285,9 +238,6 @@ synaptics_check_capabilities (GtkBuilder *dialog) gtk_widget_set_sensitive (WID ("tap_to_click_toggle"), FALSE); } - if (!data[3]) - gtk_widget_set_sensitive (WID ("scroll_twofinger_radio"), FALSE); - XFree (data); } @@ -437,14 +387,11 @@ setup_dialog (GtkBuilder *dialog) g_settings_bind (touchpad_settings, "tap-to-click", WID ("tap_to_click_toggle"), "active", G_SETTINGS_BIND_DEFAULT); - g_settings_bind (touchpad_settings, "horiz-scroll-enabled", - WID ("horiz_scroll_toggle"), "active", - G_SETTINGS_BIND_DEFAULT); - g_settings_bind (touchpad_settings, "natural-scroll", - WID ("natural_scroll_toggle"), "active", - G_SETTINGS_BIND_DEFAULT); - - scrollmethod_gsettings_changed_event (touchpad_settings, "scroll-method", dialog); + g_settings_bind (touchpad_settings, "vertical-edge-scrolling", WID ("vert_edge_scroll_toggle"), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind (touchpad_settings, "horizontal-edge-scrolling", WID ("horiz_edge_scroll_toggle"), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind (touchpad_settings, "vertical-two-finger-scrolling", WID ("vert_twofinger_scroll_toggle"), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind (touchpad_settings, "horizontal-two-finger-scrolling", WID ("horiz_twofinger_scroll_toggle"), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind (touchpad_settings, "natural-scroll", WID ("natural_scroll_toggle"), "active", G_SETTINGS_BIND_DEFAULT); char * emulation_values[] = { _("Disabled"), _("Left button"), _("Middle button"), _("Right button") }; @@ -465,20 +412,7 @@ setup_dialog (GtkBuilder *dialog) g_signal_connect (two_click_comboxbox, "changed", G_CALLBACK (comboxbox_changed_callback), "two-finger-click"); g_signal_connect (three_click_comboxbox, "changed", G_CALLBACK (comboxbox_changed_callback), "three-finger-click"); - radio = GTK_RADIO_BUTTON (WID ("scroll_disabled_radio")); - GSList *radio_group = gtk_radio_button_get_group (radio); - GSList *item = NULL; - synaptics_check_capabilities (dialog); - for (item = radio_group; item != NULL; item = item->next) { - g_signal_connect (G_OBJECT (item->data), "clicked", - G_CALLBACK(scrollmethod_clicked_event), - dialog); - } - g_signal_connect (touchpad_settings, - "changed::scroll-method", - G_CALLBACK(scrollmethod_gsettings_changed_event), - dialog); } } diff --git a/capplets/mouse/mate-mouse-properties.ui b/capplets/mouse/mate-mouse-properties.ui index cee64c08..898e6f74 100644 --- a/capplets/mouse/mate-mouse-properties.ui +++ b/capplets/mouse/mate-mouse-properties.ui @@ -1,7 +1,7 @@ + - 1 10 @@ -30,26 +30,6 @@ 100 100 - - 0.5 - 3 - 1.2 - 0.10000000000000001 - 0.10000000000000001 - - - 0.20000000000000001 - 3 - 1.2 - 0.10000000000000001 - 0.10000000000000001 - - - 30 - 15 - 1 - 1 - False 5 @@ -58,23 +38,23 @@ 550 dialog - + True False 2 - + True False end gtk-help + False True True True False - False True @@ -86,11 +66,11 @@ gtk-close + False True True True False - False True @@ -129,8 +109,8 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 Mouse Orientation + 0 @@ -157,12 +137,13 @@ _Right-handed + False True True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False True + 0.5 True True @@ -175,12 +156,13 @@ _Left-handed + False True True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False True + 0.5 True True right_handed_radio @@ -217,8 +199,8 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 Locate Pointer + 0 @@ -239,12 +221,13 @@ Sh_ow position of pointer when the Control key is pressed + False True True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False True + 0.5 True @@ -272,8 +255,8 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 Pointer Speed + 0 @@ -303,11 +286,11 @@ True False - 0 _Acceleration: True center accel_scale + 0 GTK_FILL @@ -318,11 +301,11 @@ True False - 0 _Sensitivity: True center sensitivity_scale + 0 1 @@ -341,9 +324,9 @@ True False - 1 Slow center + 1 @@ -373,9 +356,9 @@ True False - 0 Fast center + 0 @@ -403,9 +386,9 @@ True False - 1 Low center + 1 @@ -435,9 +418,9 @@ True False - 0 High center + 0 @@ -483,8 +466,8 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 Drag and Drop + 0 @@ -517,11 +500,11 @@ True False - 0 Thr_eshold: True center drag_threshold_scale + 0 False @@ -538,9 +521,9 @@ True False - 1 Small center + 1 @@ -575,8 +558,8 @@ True False - 0 Large + 0 @@ -628,8 +611,8 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 Double-Click Timeout + 0 @@ -662,11 +645,11 @@ True False - 0 _Timeout: True center delay_scale + 0 False @@ -683,8 +666,8 @@ True False - 1 Short + 1 @@ -718,8 +701,8 @@ True False - 0 Long + 0 @@ -757,9 +740,9 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 To test your double-click settings, try to double-click on the light bulb. True + 0 @@ -837,12 +820,13 @@ Enable _touchpad + False True True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False True + 0.5 True @@ -862,9 +846,9 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + General 0 0 - General @@ -885,9 +869,9 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 0 - False @@ -898,12 +882,13 @@ Disable touchpad _while typing + False True True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False True + 0.5 True True @@ -930,9 +915,9 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 0 - False @@ -943,12 +928,13 @@ Enable _mouse clicks with touchpad + False True True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False True + 0.5 True True @@ -975,9 +961,9 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 0 - False @@ -997,8 +983,8 @@ True False - 0 Two-finger click emulation: + 0 @@ -1009,8 +995,8 @@ True False - 0 Three-finger click emulation: + 0 1 @@ -1079,9 +1065,9 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Scrolling 0 0 - Scrolling @@ -1093,18 +1079,18 @@ - + True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 0 - False @@ -1113,59 +1099,16 @@ - + + V_ertical edge scrolling + False True - False - - - _Disabled - True - True - False - False - True - True - - - False - False - 0 - - - - - _Edge scrolling - True - True - False - False - True - True - scroll_disabled_radio - - - False - False - 1 - - - - - Two-_finger scrolling - True - True - False - False - True - True - scroll_disabled_radio - - - False - False - 2 - - + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + 0 + True True @@ -1181,18 +1124,18 @@ - + True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 0 - False @@ -1201,14 +1144,15 @@ - - Enable n_atural scrolling + + H_orizontal edge scrolling + False True True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False True + 0 True @@ -1225,18 +1169,63 @@ - + True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 0 + + + False + False + 0 + + + + + Vertical two-finger scrolling + False + True + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + 0 + True + + + True + True + 1 + + + + + False + False + 3 + + + + + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + 0 False @@ -1245,14 +1234,60 @@ - - Enable h_orizontal scrolling + + H_orizontal two-finger scrolling + False True True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + 0 + True + + + True + True + 1 + + + + + False + False + 4 + + + + + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + 0 + 0 + + + False + False + 0 + + + + + Enable n_atural scrolling False + True + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK True + 0 True @@ -1265,7 +1300,7 @@ False False - 3 + 5 @@ -1306,4 +1341,24 @@ closebutton1 + + 0.5 + 3 + 1.2 + 0.10000000000000001 + 0.10000000000000001 + + + 0.20000000000000001 + 3 + 1.2 + 0.10000000000000001 + 0.10000000000000001 + + + 30 + 15 + 1 + 1 + -- cgit v1.2.1