[mutter/wip/carlosg/capabilities-and-dimensions: 4/11] backends: Use capabilities to figure out trackballs in MetaInputSettings
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/capabilities-and-dimensions: 4/11] backends: Use capabilities to figure out trackballs in MetaInputSettings
- Date: Tue, 6 Sep 2022 15:38:34 +0000 (UTC)
commit f1f87b17a28d661557cbd8cae1f861723e0f89ef
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Sep 6 10:20:21 2022 +0200
backends: Use capabilities to figure out trackballs in MetaInputSettings
Port these configuration methods to use capabilities, instead of using the
internal vfunc.
src/backends/meta-input-settings.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c
index 7d03d7182c..1e00c6e475 100644
--- a/src/backends/meta-input-settings.c
+++ b/src/backends/meta-input-settings.c
@@ -930,12 +930,18 @@ update_trackball_scroll_button (MetaInputSettings *input_settings,
MetaInputSettingsPrivate *priv;
guint button;
gboolean button_lock;
+ ClutterInputCapabilities caps;
priv = meta_input_settings_get_instance_private (input_settings);
input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
- if (device && !input_settings_class->is_trackball_device (input_settings, device))
- return;
+ if (device)
+ {
+ caps = clutter_input_device_get_capabilities (device);
+
+ if ((caps & CLUTTER_INPUT_CAPABILITY_TRACKBALL) == 0)
+ return;
+ }
/* This key is 'i' in the schema but it also specifies a minimum
* range of 0 so the cast here is safe. */
@@ -953,8 +959,9 @@ update_trackball_scroll_button (MetaInputSettings *input_settings,
for (l = priv->devices; l; l = l->next)
{
device = l->data;
+ caps = clutter_input_device_get_capabilities (device);
- if (input_settings_class->is_trackball_device (input_settings, device))
+ if ((caps & CLUTTER_INPUT_CAPABILITY_TRACKBALL) != 0)
input_settings_class->set_scroll_button (input_settings, device, button, button_lock);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]