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
This commit is contained in:
Carlos Garnacho 2015-03-16 15:25:59 +01:00
parent 3ff6316562
commit 9b50119d31
2 changed files with 33 additions and 0 deletions

View File

@ -70,6 +70,10 @@ struct _MetaInputSettingsClass
ClutterInputDevice *device, ClutterInputDevice *device,
guint button); guint button);
void (* set_click_method) (MetaInputSettings *settings,
ClutterInputDevice *device,
GDesktopTouchpadClickMethod mode);
void (* set_keyboard_repeat) (MetaInputSettings *settings, void (* set_keyboard_repeat) (MetaInputSettings *settings,
gboolean repeat, gboolean repeat,
guint delay, guint delay,

View File

@ -379,6 +379,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 static void
update_touchpad_send_events (MetaInputSettings *input_settings, update_touchpad_send_events (MetaInputSettings *input_settings,
ClutterInputDevice *device) ClutterInputDevice *device)
@ -569,6 +595,8 @@ meta_input_settings_changed_cb (GSettings *settings,
update_touchpad_send_events (input_settings, NULL); update_touchpad_send_events (input_settings, NULL);
else if (strcmp (key, "scroll-method") == 0) else if (strcmp (key, "scroll-method") == 0)
update_touchpad_scroll_method (input_settings, NULL); 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) 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_left_handed (input_settings, device);
update_touchpad_tap_enabled (input_settings, device); update_touchpad_tap_enabled (input_settings, device);
update_touchpad_scroll_method (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_touchpad_send_events (input_settings, device);
update_device_speed (input_settings, priv->touchpad_settings, update_device_speed (input_settings, priv->touchpad_settings,