clutter: Drop clutter_input_device_get_physical_devices() API

This is unused, we have the seat for this kind of stuff.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
This commit is contained in:
Carlos Garnacho 2020-11-18 17:13:30 +01:00 committed by Marge Bot
parent 699da157c7
commit c4fa5ef88a
5 changed files with 4 additions and 109 deletions

View File

@ -88,8 +88,6 @@ struct _ClutterInputDevice
/* the associated device */ /* the associated device */
ClutterInputDevice *associated; ClutterInputDevice *associated;
GList *physical_devices;
/* the actor underneath the pointer */ /* the actor underneath the pointer */
ClutterActor *cursor_actor; ClutterActor *cursor_actor;
GHashTable *inv_touch_sequence_actors; GHashTable *inv_touch_sequence_actors;
@ -142,12 +140,6 @@ CLUTTER_EXPORT
void _clutter_input_device_set_associated_device (ClutterInputDevice *device, void _clutter_input_device_set_associated_device (ClutterInputDevice *device,
ClutterInputDevice *associated); ClutterInputDevice *associated);
CLUTTER_EXPORT CLUTTER_EXPORT
void _clutter_input_device_add_physical_device (ClutterInputDevice *logical,
ClutterInputDevice *physical);
CLUTTER_EXPORT
void _clutter_input_device_remove_physical_device (ClutterInputDevice *logical,
ClutterInputDevice *physical);
CLUTTER_EXPORT
void clutter_input_device_update_from_tool (ClutterInputDevice *device, void clutter_input_device_update_from_tool (ClutterInputDevice *device,
ClutterInputDeviceTool *tool); ClutterInputDeviceTool *tool);
CLUTTER_EXPORT CLUTTER_EXPORT

View File

@ -96,9 +96,6 @@ clutter_input_device_dispose (GObject *gobject)
if (device->associated != NULL) if (device->associated != NULL)
{ {
if (device->device_mode == CLUTTER_INPUT_MODE_PHYSICAL)
_clutter_input_device_remove_physical_device (device->associated, device);
_clutter_input_device_set_associated_device (device->associated, NULL); _clutter_input_device_set_associated_device (device->associated, NULL);
g_object_unref (device->associated); g_object_unref (device->associated);
device->associated = NULL; device->associated = NULL;
@ -1040,42 +1037,6 @@ clutter_input_device_get_n_axes (ClutterInputDevice *device)
return 0; return 0;
} }
/*< private >
* clutter_input_device_add_physical_device:
* @logical: a #ClutterInputDevice
* @physical: a #ClutterInputDevice
*
* Adds @physical to the list of physical devices of @logical
*
* This function does not increase the reference count of either @logical
* or @physical.
*/
void
_clutter_input_device_add_physical_device (ClutterInputDevice *logical,
ClutterInputDevice *physical)
{
if (g_list_find (logical->physical_devices, physical) == NULL)
logical->physical_devices = g_list_prepend (logical->physical_devices, physical);
}
/*< private >
* clutter_input_device_remove_physical_device:
* @logical: a #ClutterInputDevice
* @physical: a #ClutterInputDevice
*
* Removes @physical from the list of physical devices of @logical.
*
* This function does not decrease the reference count of either @logical
* or @physical.
*/
void
_clutter_input_device_remove_physical_device (ClutterInputDevice *logical,
ClutterInputDevice *physical)
{
if (g_list_find (logical->physical_devices, physical) != NULL)
logical->physical_devices = g_list_remove (logical->physical_devices, physical);
}
/*< private > /*< private >
* clutter_input_device_remove_sequence: * clutter_input_device_remove_sequence:
* @device: a #ClutterInputDevice * @device: a #ClutterInputDevice
@ -1112,26 +1073,6 @@ _clutter_input_device_remove_event_sequence (ClutterInputDevice *device,
} }
} }
/**
* clutter_input_device_get_physical_devices:
* @device: a #ClutterInputDevice
*
* Retrieves the physical devices attached to @device.
*
* Return value: (transfer container) (element-type Clutter.InputDevice): a
* list of #ClutterInputDevice, or %NULL. The contents of the list are
* owned by the device. Use g_list_free() when done
*
* Since: 1.6
*/
GList *
clutter_input_device_get_physical_devices (ClutterInputDevice *device)
{
g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), NULL);
return g_list_copy (device->physical_devices);
}
/*< internal > /*< internal >
* clutter_input_device_set_associated_device: * clutter_input_device_set_associated_device:
* @device: a #ClutterInputDevice * @device: a #ClutterInputDevice

View File

@ -106,8 +106,6 @@ gboolean clutter_input_device_get_axis_value (ClutterInputDev
CLUTTER_EXPORT CLUTTER_EXPORT
ClutterInputDevice * clutter_input_device_get_associated_device (ClutterInputDevice *device); ClutterInputDevice * clutter_input_device_get_associated_device (ClutterInputDevice *device);
CLUTTER_EXPORT
GList * clutter_input_device_get_physical_devices (ClutterInputDevice *device);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_input_device_grab (ClutterInputDevice *device, void clutter_input_device_grab (ClutterInputDevice *device,

View File

@ -1527,10 +1527,7 @@ evdev_add_device (MetaSeatImpl *seat_impl,
master = seat_impl->core_pointer; master = seat_impl->core_pointer;
if (master) if (master)
{ _clutter_input_device_set_associated_device (device, master);
_clutter_input_device_set_associated_device (device, master);
_clutter_input_device_add_physical_device (master, device);
}
is_touchscreen = type == CLUTTER_TOUCHSCREEN_DEVICE; is_touchscreen = type == CLUTTER_TOUCHSCREEN_DEVICE;
is_tablet_switch = is_tablet_switch =

View File

@ -664,7 +664,6 @@ add_device (MetaSeatX11 *seat_x11,
logical = g_hash_table_lookup (seat_x11->devices_by_id, logical = g_hash_table_lookup (seat_x11->devices_by_id,
GINT_TO_POINTER (info->attachment)); GINT_TO_POINTER (info->attachment));
_clutter_input_device_set_associated_device (device, logical); _clutter_input_device_set_associated_device (device, logical);
_clutter_input_device_add_physical_device (logical, device);
} }
} }
@ -757,21 +756,6 @@ relate_logical_devices (gpointer key,
_clutter_input_device_set_associated_device (relative, device); _clutter_input_device_set_associated_device (relative, device);
} }
static void
relate_physical_devices (gpointer key,
gpointer value,
gpointer data)
{
MetaSeatX11 *seat_x11 = data;
ClutterInputDevice *logical, *physical;
physical = g_hash_table_lookup (seat_x11->devices_by_id, key);
logical = g_hash_table_lookup (seat_x11->devices_by_id, value);
_clutter_input_device_set_associated_device (physical, logical);
_clutter_input_device_add_physical_device (logical, physical);
}
static uint static uint
device_get_tool_serial (ClutterInputDevice *device) device_get_tool_serial (ClutterInputDevice *device)
{ {
@ -879,10 +863,7 @@ translate_hierarchy_event (ClutterBackend *backend,
/* detach the physical device in both cases */ /* detach the physical device in both cases */
if (logical != NULL) if (logical != NULL)
{ _clutter_input_device_set_associated_device (physical, NULL);
_clutter_input_device_remove_physical_device (logical, physical);
_clutter_input_device_set_associated_device (physical, NULL);
}
/* and attach the physical device to the new logical device if needed */ /* and attach the physical device to the new logical device if needed */
if (ev->info[i].flags & XISlaveAttached) if (ev->info[i].flags & XISlaveAttached)
@ -897,10 +878,7 @@ translate_hierarchy_event (ClutterBackend *backend,
logical = g_hash_table_lookup (seat_x11->devices_by_id, logical = g_hash_table_lookup (seat_x11->devices_by_id,
GINT_TO_POINTER (info->attachment)); GINT_TO_POINTER (info->attachment));
if (logical != NULL) if (logical != NULL)
{ _clutter_input_device_set_associated_device (physical, logical);
_clutter_input_device_set_associated_device (physical, logical);
_clutter_input_device_add_physical_device (logical, physical);
}
XIFreeDeviceInfo (info); XIFreeDeviceInfo (info);
} }
} }
@ -1411,7 +1389,7 @@ meta_seat_x11_constructed (GObject *object)
{ {
MetaSeatX11 *seat_x11 = META_SEAT_X11 (object); MetaSeatX11 *seat_x11 = META_SEAT_X11 (object);
ClutterBackend *backend = clutter_get_default_backend (); ClutterBackend *backend = clutter_get_default_backend ();
GHashTable *logical_devices, *physical_devices; GHashTable *logical_devices;
XIDeviceInfo *info; XIDeviceInfo *info;
XIEventMask event_mask; XIEventMask event_mask;
unsigned char mask[XIMaskLen(XI_LASTEVENT)] = { 0, }; unsigned char mask[XIMaskLen(XI_LASTEVENT)] = { 0, };
@ -1420,7 +1398,6 @@ meta_seat_x11_constructed (GObject *object)
xdisplay = clutter_x11_get_default_display (); xdisplay = clutter_x11_get_default_display ();
logical_devices = g_hash_table_new (NULL, NULL); logical_devices = g_hash_table_new (NULL, NULL);
physical_devices = g_hash_table_new (NULL, NULL);
info = XIQueryDevice (clutter_x11_get_default_display (), info = XIQueryDevice (clutter_x11_get_default_display (),
XIAllDevices, &n_devices); XIAllDevices, &n_devices);
@ -1441,13 +1418,6 @@ meta_seat_x11_constructed (GObject *object)
GINT_TO_POINTER (xi_device->deviceid), GINT_TO_POINTER (xi_device->deviceid),
GINT_TO_POINTER (xi_device->attachment)); GINT_TO_POINTER (xi_device->attachment));
} }
else if (xi_device->use == XISlavePointer ||
xi_device->use == XISlaveKeyboard)
{
g_hash_table_insert (physical_devices,
GINT_TO_POINTER (xi_device->deviceid),
GINT_TO_POINTER (xi_device->attachment));
}
} }
XIFreeDeviceInfo (info); XIFreeDeviceInfo (info);
@ -1455,9 +1425,6 @@ meta_seat_x11_constructed (GObject *object)
g_hash_table_foreach (logical_devices, relate_logical_devices, seat_x11); g_hash_table_foreach (logical_devices, relate_logical_devices, seat_x11);
g_hash_table_destroy (logical_devices); g_hash_table_destroy (logical_devices);
g_hash_table_foreach (physical_devices, relate_physical_devices, seat_x11);
g_hash_table_destroy (physical_devices);
XISetMask (mask, XI_HierarchyChanged); XISetMask (mask, XI_HierarchyChanged);
XISetMask (mask, XI_DeviceChanged); XISetMask (mask, XI_DeviceChanged);
XISetMask (mask, XI_PropertyEvent); XISetMask (mask, XI_PropertyEvent);