diff options
author | monsta <[email protected]> | 2016-11-01 12:34:15 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-11-01 12:38:09 +0300 |
commit | 77b1956a67bdc09fef7c76a459ca431008fde8f6 (patch) | |
tree | 37226c7315fce5fd46b8e6363911d24aee5ca794 | |
parent | 6d2b4fe2b83733cb8431b93177e4d00db58ba5d0 (diff) | |
download | mate-settings-daemon-77b1956a67bdc09fef7c76a459ca431008fde8f6.tar.bz2 mate-settings-daemon-77b1956a67bdc09fef7c76a459ca431008fde8f6.tar.xz |
mouse: add separate keys for touchpad motion settings (not used yet)
schema: org.mate.peripherals-touchpad
keys: motion-acceleration, motion-threshold (same as in peripherals-mouse schema)
types and default values: also same as for mouse
adapted from:
https://git.gnome.org/browse/gnome-settings-daemon/commit/?id=122aee4e56d6ed94c41dfbcac0bece1921629de7
-rw-r--r-- | data/org.mate.peripherals-touchpad.gschema.xml.in | 10 | ||||
-rw-r--r-- | plugins/mouse/msd-mouse-manager.c | 12 |
2 files changed, 16 insertions, 6 deletions
diff --git a/data/org.mate.peripherals-touchpad.gschema.xml.in b/data/org.mate.peripherals-touchpad.gschema.xml.in index d3557dd..84aae6b 100644 --- a/data/org.mate.peripherals-touchpad.gschema.xml.in +++ b/data/org.mate.peripherals-touchpad.gschema.xml.in @@ -75,5 +75,15 @@ <summary>Touchpad button orientation</summary> <description>Swap left and right buttons for left-handed touchpads with 'left', 'right' for right-handed, 'mouse' to follow the mouse setting.</description> </key> + <key name="motion-acceleration" type="d"> + <default>-1</default> + <summary>Single Click</summary> + <description>Acceleration multiplier for touchpad motion. A value of -1 is the system default.</description> + </key> + <key name="motion-threshold" type="i"> + <default>-1</default> + <summary>Motion Threshold</summary> + <description>Distance in pixels the pointer must move before accelerated touchpad motion is activated. A value of -1 is the system default.</description> + </key> </schema> </schemalist> diff --git a/plugins/mouse/msd-mouse-manager.c b/plugins/mouse/msd-mouse-manager.c index bf140c2..929096d 100644 --- a/plugins/mouse/msd-mouse-manager.c +++ b/plugins/mouse/msd-mouse-manager.c @@ -52,11 +52,11 @@ /* Keys with same names for both touchpad and mouse */ #define KEY_LEFT_HANDED "left-handed" /* a boolean for mouse, an enum for touchpad */ +#define KEY_MOTION_ACCELERATION "motion-acceleration" +#define KEY_MOTION_THRESHOLD "motion-threshold" /* Mouse settings */ #define MATE_MOUSE_SCHEMA "org.mate.peripherals-mouse" -#define KEY_MOUSE_MOTION_ACCELERATION "motion-acceleration" -#define KEY_MOUSE_MOTION_THRESHOLD "motion-threshold" #define KEY_MOUSE_LOCATE_POINTER "locate-pointer" #define KEY_MIDDLE_BUTTON_EMULATION "middle-button-enabled" @@ -983,8 +983,8 @@ set_mouse_settings (MsdMouseManager *manager) gboolean touchpad_left_handed = get_touchpad_handedness (manager, mouse_left_handed); set_left_handed_all (manager, mouse_left_handed, touchpad_left_handed); - set_motion_acceleration (manager, g_settings_get_double (manager->priv->settings_mouse, KEY_MOUSE_MOTION_ACCELERATION)); - set_motion_threshold (manager, g_settings_get_int (manager->priv->settings_mouse, KEY_MOUSE_MOTION_THRESHOLD)); + set_motion_acceleration (manager, g_settings_get_double (manager->priv->settings_mouse, KEY_MOTION_ACCELERATION)); + set_motion_threshold (manager, g_settings_get_int (manager->priv->settings_mouse, KEY_MOTION_THRESHOLD)); set_middle_button_all (manager, g_settings_get_boolean (manager->priv->settings_mouse, KEY_MIDDLE_BUTTON_EMULATION)); set_disable_w_typing (manager, g_settings_get_boolean (manager->priv->settings_touchpad, KEY_TOUCHPAD_DISABLE_W_TYPING)); @@ -1005,9 +1005,9 @@ mouse_callback (GSettings *settings, gboolean mouse_left_handed = g_settings_get_boolean (settings, key); gboolean touchpad_left_handed = get_touchpad_handedness (manager, mouse_left_handed); set_left_handed_all (manager, mouse_left_handed, touchpad_left_handed); - } else if (g_strcmp0 (key, KEY_MOUSE_MOTION_ACCELERATION) == 0) { + } else if (g_strcmp0 (key, KEY_MOTION_ACCELERATION) == 0) { set_motion_acceleration (manager, g_settings_get_double (settings, key)); - } else if (g_strcmp0 (key, KEY_MOUSE_MOTION_THRESHOLD) == 0) { + } else if (g_strcmp0 (key, KEY_MOTION_THRESHOLD) == 0) { set_motion_threshold (manager, g_settings_get_int (settings, key)); } else if (g_strcmp0 (key, KEY_MIDDLE_BUTTON_EMULATION) == 0) { set_middle_button_all (manager, g_settings_get_boolean (settings, key)); |