mirror of
https://github.com/brl/mutter.git
synced 2025-07-16 23:27:18 +00:00
input-settings: detect trackball using udev ID_INPUT_TRACKBALL
Previously, trackballs were detected based on the presence of the substring "trackball" in the device name. This had the downside of missing devices, such as the Kensington Expert Mouse, which don't have "trackball" in their names. Rather than depending on the device name, use the ID_INPUT_TRACKBALL property from udev to determine whether or not to treat a device as a trackball. This adds a new function, `is_trackball_device`, to MetaInputEvents, and eliminates the `meta_input_device_is_trackball` function. Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/258
This commit is contained in:
@ -398,9 +398,10 @@ is_mouse_device (ClutterInputDevice *device)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_trackball_device (ClutterInputDevice *device)
|
||||
meta_input_settings_native_is_trackball_device (MetaInputSettings *settings,
|
||||
ClutterInputDevice *device)
|
||||
{
|
||||
return meta_input_device_is_trackball (device);
|
||||
return has_udev_property (device, "ID_INPUT_TRACKBALL");
|
||||
}
|
||||
|
||||
static void
|
||||
@ -419,7 +420,7 @@ meta_input_settings_native_set_trackball_accel_profile (MetaInputSettings
|
||||
ClutterInputDevice *device,
|
||||
GDesktopPointerAccelProfile profile)
|
||||
{
|
||||
if (!is_trackball_device (device))
|
||||
if (!meta_input_settings_native_is_trackball_device (settings, device))
|
||||
return;
|
||||
|
||||
set_device_accel_profile (device, profile);
|
||||
@ -588,6 +589,7 @@ meta_input_settings_native_class_init (MetaInputSettingsNativeClass *klass)
|
||||
input_settings_class->set_stylus_button_map = meta_input_settings_native_set_stylus_button_map;
|
||||
|
||||
input_settings_class->has_two_finger_scroll = meta_input_settings_native_has_two_finger_scroll;
|
||||
input_settings_class->is_trackball_device = meta_input_settings_native_is_trackball_device;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user