diff options
author | Victor Kareh <[email protected]> | 2019-08-02 14:50:35 -0400 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-08-12 09:29:21 +0200 |
commit | cffe62015c2d4c168f11fb570d2f671ed0a99534 (patch) | |
tree | 64a208a0a67afe0d55e92773ba8e4437f1812f9a /capplets/mouse/mate-mouse-properties.c | |
parent | 5642efc49cb3f7b881d64a14277ab024fef7d102 (diff) | |
download | mate-control-center-cffe62015c2d4c168f11fb570d2f671ed0a99534.tar.bz2 mate-control-center-cffe62015c2d4c168f11fb570d2f671ed0a99534.tar.xz |
mouse: Add support for Acceleration Profiles
Currently libinput supports Adaptive and Flat acceleration profiles. We
can use these to change mouse behavior. Synaptic touchpads are not
supported through libinput, so I have not included a UI change for this
(even though it's technically supported in gsettings).
The Default acceleration profile reads the value from the libinput
defaults and sets them as the current profile. Usually ends up being
Adaptive.
Diffstat (limited to 'capplets/mouse/mate-mouse-properties.c')
-rw-r--r-- | capplets/mouse/mate-mouse-properties.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/capplets/mouse/mate-mouse-properties.c b/capplets/mouse/mate-mouse-properties.c index 2c2292a4..a3c06e60 100644 --- a/capplets/mouse/mate-mouse-properties.c +++ b/capplets/mouse/mate-mouse-properties.c @@ -49,6 +49,12 @@ enum DOUBLE_CLICK_TEST_ON }; +typedef enum { + ACCEL_PROFILE_DEFAULT, + ACCEL_PROFILE_ADAPTIVE, + ACCEL_PROFILE_FLAT +} AccelProfile; + #define MOUSE_SCHEMA "org.mate.peripherals-mouse" #define INTERFACE_SCHEMA "org.mate.interface" #define DOUBLE_CLICK_KEY "double-click" @@ -218,6 +224,13 @@ synaptics_check_capabilities (GtkBuilder *dialog) } static void +accel_profile_combobox_changed_callback (GtkWidget *combobox, void *data) +{ + AccelProfile value = gtk_combo_box_get_active (GTK_COMBO_BOX (combobox)); + g_settings_set_enum (mouse_settings, (const gchar *) "accel-profile", value); +} + +static void comboxbox_changed (GtkWidget *combobox, GtkBuilder *dialog, const char *key) { gint value = gtk_combo_box_get_active (GTK_COMBO_BOX (combobox)); @@ -293,6 +306,11 @@ setup_dialog (GtkBuilder *dialog) gtk_range_get_adjustment (GTK_RANGE (WID ("sensitivity_scale"))), "value", G_SETTINGS_BIND_DEFAULT); + g_signal_connect (WID ("mouse_accel_profile"), "changed", + G_CALLBACK (accel_profile_combobox_changed_callback), NULL); + gtk_combo_box_set_active (GTK_COMBO_BOX (WID ("mouse_accel_profile")), + g_settings_get_enum (mouse_settings, "accel-profile")); + /* DnD threshold */ g_settings_bind (mouse_settings, "drag-threshold", gtk_range_get_adjustment (GTK_RANGE (WID ("drag_threshold_scale"))), "value", |