mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
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:
parent
3ff6316562
commit
9b50119d31
@ -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,
|
||||
|
@ -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
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user