diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2015-03-16 15:25:59 +0100 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2015-03-16 18:05:51 +0100 |
commit | 9b50119d31728fb53c1065aa3155708a9f02ea07 (patch) | |
tree | 195a5e9ea862e57f88f22d5e604f89948037b242 | |
parent | 3ff63165621eef9ca900d7fcde2c25ee194d6a95 (diff) |
backend: Add set_click_method MetaInputSettings vfunc
This will configure the libinput_config_click_method for touchpads.
https://bugzilla.gnome.org/show_bug.cgi?id=746290
-rw-r--r-- | src/backends/meta-input-settings-private.h | 4 | ||||
-rw-r--r-- | src/backends/meta-input-settings.c | 29 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/backends/meta-input-settings-private.h b/src/backends/meta-input-settings-private.h index 666a2124..18c1edbc 100644 --- a/src/backends/meta-input-settings-private.h +++ b/src/backends/meta-input-settings-private.h @@ -70,6 +70,10 @@ struct _MetaInputSettingsClass ClutterInputDevice *device, guint button); + void (* set_click_method) (MetaInputSettings *settings, + ClutterInputDevice *device, + GDesktopTouchpadClickMethod mode); + void (* set_keyboard_repeat) (MetaInputSettings *settings, gboolean repeat, guint delay, diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c index dc792e01..4860fa96 100644 --- a/src/backends/meta-input-settings.c +++ b/src/backends/meta-input-settings.c @@ -380,6 +380,32 @@ update_touchpad_scroll_method (MetaInputSettings *input_settings, } static void +update_touchpad_click_method (MetaInputSettings *input_settings, + ClutterInputDevice *device) +{ + MetaInputSettingsClass *input_settings_class; + GDesktopTouchpadScrollMethod method; + MetaInputSettingsPrivate *priv; + + priv = meta_input_settings_get_instance_private (input_settings); + input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings); + method = g_settings_get_enum (priv->touchpad_settings, "click-method"); + + if (device) + { + settings_device_set_uint_setting (input_settings, device, + input_settings_class->set_click_method, + method); + } + else + { + settings_set_uint_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE, + (ConfigUintFunc) input_settings_class->set_click_method, + method); + } +} + +static void update_touchpad_send_events (MetaInputSettings *input_settings, ClutterInputDevice *device) { @@ -569,6 +595,8 @@ meta_input_settings_changed_cb (GSettings *settings, update_touchpad_send_events (input_settings, NULL); else if (strcmp (key, "scroll-method") == 0) update_touchpad_scroll_method (input_settings, NULL); + else if (strcmp (key, "click-method") == 0) + update_touchpad_click_method (input_settings, NULL); } else if (settings == priv->trackball_settings) { @@ -705,6 +733,7 @@ meta_input_settings_device_added (ClutterDeviceManager *device_manager, update_touchpad_left_handed (input_settings, device); update_touchpad_tap_enabled (input_settings, device); update_touchpad_scroll_method (input_settings, device); + update_touchpad_click_method (input_settings, device); update_touchpad_send_events (input_settings, device); update_device_speed (input_settings, priv->touchpad_settings, |