[mutter/wip/carlosg/input-thread: 12/32] clutter: Drop clutter_input_device_get_physical_devices() API




commit b27fc185f6fc4e67d6267a10c6119c70e41e56cd
Author: Carlos Garnacho <carlosg gnome org>
Date:   Wed Nov 18 17:13:30 2020 +0100

    clutter: Drop clutter_input_device_get_physical_devices() API
    
    This is unused, we have the seat for this kind of stuff.

 clutter/clutter/clutter-input-device-private.h |  8 ----
 clutter/clutter/clutter-input-device.c         | 59 --------------------------
 clutter/clutter/clutter-input-device.h         |  2 -
 src/backends/native/meta-seat-impl.c           |  5 +--
 src/backends/x11/meta-seat-x11.c               | 39 ++---------------
 5 files changed, 4 insertions(+), 109 deletions(-)
---
diff --git a/clutter/clutter/clutter-input-device-private.h b/clutter/clutter/clutter-input-device-private.h
index 31be9dfef2..6fe519bdb2 100644
--- a/clutter/clutter/clutter-input-device-private.h
+++ b/clutter/clutter/clutter-input-device-private.h
@@ -88,8 +88,6 @@ struct _ClutterInputDevice
   /* the associated device */
   ClutterInputDevice *associated;
 
-  GList *physical_devices;
-
   /* the actor underneath the pointer */
   ClutterActor *cursor_actor;
   GHashTable   *inv_touch_sequence_actors;
@@ -142,12 +140,6 @@ CLUTTER_EXPORT
 void _clutter_input_device_set_associated_device (ClutterInputDevice *device,
                                                   ClutterInputDevice *associated);
 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,
                                             ClutterInputDeviceTool *tool);
 CLUTTER_EXPORT
diff --git a/clutter/clutter/clutter-input-device.c b/clutter/clutter/clutter-input-device.c
index e6c6f6f79c..41a941ad98 100644
--- a/clutter/clutter/clutter-input-device.c
+++ b/clutter/clutter/clutter-input-device.c
@@ -96,9 +96,6 @@ clutter_input_device_dispose (GObject *gobject)
 
   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);
       g_object_unref (device->associated);
       device->associated = NULL;
@@ -1040,42 +1037,6 @@ clutter_input_device_get_n_axes (ClutterInputDevice *device)
   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 >
  * clutter_input_device_remove_sequence:
  * @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 >
  * clutter_input_device_set_associated_device:
  * @device: a #ClutterInputDevice
diff --git a/clutter/clutter/clutter-input-device.h b/clutter/clutter/clutter-input-device.h
index 78b09ef2a9..42948f5914 100644
--- a/clutter/clutter/clutter-input-device.h
+++ b/clutter/clutter/clutter-input-device.h
@@ -106,8 +106,6 @@ gboolean                clutter_input_device_get_axis_value     (ClutterInputDev
 
 CLUTTER_EXPORT
 ClutterInputDevice *    clutter_input_device_get_associated_device (ClutterInputDevice *device);
-CLUTTER_EXPORT
-GList *                 clutter_input_device_get_physical_devices  (ClutterInputDevice  *device);
 
 CLUTTER_EXPORT
 void                    clutter_input_device_grab               (ClutterInputDevice  *device,
diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c
index 6bcbbf7511..6530a89310 100644
--- a/src/backends/native/meta-seat-impl.c
+++ b/src/backends/native/meta-seat-impl.c
@@ -1518,10 +1518,7 @@ evdev_add_device (MetaSeatImpl           *seat_impl,
     master = seat_impl->core_pointer;
 
   if (master)
-    {
-      _clutter_input_device_set_associated_device (device, master);
-      _clutter_input_device_add_physical_device (master, device);
-    }
+    _clutter_input_device_set_associated_device (device, master);
 
   is_touchscreen = type == CLUTTER_TOUCHSCREEN_DEVICE;
   is_tablet_switch =
diff --git a/src/backends/x11/meta-seat-x11.c b/src/backends/x11/meta-seat-x11.c
index 26fe0680de..30fbf6b041 100644
--- a/src/backends/x11/meta-seat-x11.c
+++ b/src/backends/x11/meta-seat-x11.c
@@ -664,7 +664,6 @@ add_device (MetaSeatX11    *seat_x11,
           logical = g_hash_table_lookup (seat_x11->devices_by_id,
                                          GINT_TO_POINTER (info->attachment));
           _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);
 }
 
-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
 device_get_tool_serial (ClutterInputDevice *device)
 {
@@ -879,10 +863,7 @@ translate_hierarchy_event (ClutterBackend   *backend,
 
           /* detach the physical device in both cases */
           if (logical != NULL)
-            {
-              _clutter_input_device_remove_physical_device (logical, physical);
-              _clutter_input_device_set_associated_device (physical, NULL);
-            }
+            _clutter_input_device_set_associated_device (physical, NULL);
 
           /* and attach the physical device to the new logical device if needed */
           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,
                                                  GINT_TO_POINTER (info->attachment));
                   if (logical != NULL)
-                    {
-                      _clutter_input_device_set_associated_device (physical, logical);
-                      _clutter_input_device_add_physical_device (logical, physical);
-                    }
+                    _clutter_input_device_set_associated_device (physical, logical);
                   XIFreeDeviceInfo (info);
                 }
             }
@@ -1411,7 +1389,7 @@ meta_seat_x11_constructed (GObject *object)
 {
   MetaSeatX11 *seat_x11 = META_SEAT_X11 (object);
   ClutterBackend *backend = clutter_get_default_backend ();
-  GHashTable *logical_devices, *physical_devices;
+  GHashTable *logical_devices;
   XIDeviceInfo *info;
   XIEventMask event_mask;
   unsigned char mask[XIMaskLen(XI_LASTEVENT)] = { 0, };
@@ -1420,7 +1398,6 @@ meta_seat_x11_constructed (GObject *object)
 
   xdisplay = clutter_x11_get_default_display ();
   logical_devices = g_hash_table_new (NULL, NULL);
-  physical_devices = g_hash_table_new (NULL, NULL);
 
   info = XIQueryDevice (clutter_x11_get_default_display (),
                         XIAllDevices, &n_devices);
@@ -1441,13 +1418,6 @@ meta_seat_x11_constructed (GObject *object)
                                GINT_TO_POINTER (xi_device->deviceid),
                                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);
@@ -1455,9 +1425,6 @@ meta_seat_x11_constructed (GObject *object)
   g_hash_table_foreach (logical_devices, relate_logical_devices, seat_x11);
   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_DeviceChanged);
   XISetMask (mask, XI_PropertyEvent);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]