[mutter/wip/carlosg/input-thread: 40/95] clutter: Drop clutter_input_device_update_from_event()




commit 0cb8f61b8b1d873101dc0fd37e50982cab2a0b6a
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Jun 6 12:45:48 2020 +0200

    clutter: Drop clutter_input_device_update_from_event()
    
    Input devices aren't "updated" anymore, but their state queried to
    the seat instead. This is API only meant for embedders of Clutter,
    and is pointless to us.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403

 clutter/clutter/clutter-input-device-private.h |  3 -
 clutter/clutter/clutter-input-device.c         | 77 --------------------------
 src/tests/clutter/performance/test-common.h    |  1 -
 3 files changed, 81 deletions(-)
---
diff --git a/clutter/clutter/clutter-input-device-private.h b/clutter/clutter/clutter-input-device-private.h
index aa7c68f708..39158c4dee 100644
--- a/clutter/clutter/clutter-input-device-private.h
+++ b/clutter/clutter/clutter-input-device-private.h
@@ -238,9 +238,6 @@ ClutterInputDeviceTool *
                                      ClutterInputDeviceToolType  type);
 
 CLUTTER_EXPORT
-void clutter_input_device_update_from_event (ClutterInputDevice  *device,
-                                             ClutterEvent        *event);
-CLUTTER_EXPORT
 gboolean clutter_input_device_keycode_to_evdev (ClutterInputDevice *device,
                                                 guint               hardware_keycode,
                                                 guint              *evdev_keycode);
diff --git a/clutter/clutter/clutter-input-device.c b/clutter/clutter/clutter-input-device.c
index 8b9dbb4eac..0ff0e5404f 100644
--- a/clutter/clutter/clutter-input-device.c
+++ b/clutter/clutter/clutter-input-device.c
@@ -1076,83 +1076,6 @@ clutter_input_device_get_device_mode (ClutterInputDevice *device)
   return device->device_mode;
 }
 
-/**
- * clutter_input_device_update_from_event:
- * @device: a #ClutterInputDevice
- * @event: a #ClutterEvent
- * @update_stage: whether to update the #ClutterStage of the @device
- *   using the stage of the event
- *
- * Forcibly updates the state of the @device using a #ClutterEvent
- *
- * This function should never be used by applications: it is meant
- * for integration with embedding toolkits, like clutter-gtk
- *
- * Embedding toolkits that disable the event collection inside Clutter
- * need to use this function to update the state of input devices depending
- * on a #ClutterEvent that they are going to submit to the event handling code
- * in Clutter though clutter_do_event(). Since the input devices hold the state
- * that is going to be used to fill in fields like the #ClutterButtonEvent
- * click count, or to emit synthesized events like %CLUTTER_ENTER and
- * %CLUTTER_LEAVE, it is necessary for embedding toolkits to also be
- * responsible of updating the input device state.
- *
- * For instance, this might be the code to translate an embedding toolkit
- * native motion notification into a Clutter #ClutterMotionEvent and ask
- * Clutter to process it:
- *
- * |[
- *   ClutterEvent c_event;
- *
- *   translate_native_event_to_clutter (native_event, &c_event);
- *
- *   clutter_do_event (&c_event);
- * ]|
- *
- * Before letting clutter_do_event() process the event, it is necessary to call
- * clutter_input_device_update_from_event():
- *
- * |[
- *   ClutterEvent c_event;
- *   ClutterDeviceManager *manager;
- *   ClutterInputDevice *device;
- *
- *   translate_native_event_to_clutter (native_event, &c_event);
- *
- *   // get the seat
- *   seat = clutter_backend_get_deafult_seat (clutter_get_default_backend ());
- *
- *   // use the default Core Pointer that Clutter backends register by default
- *   device = clutter_seat_get_pointer (seat);
- *
- *   // update the state of the input device
- *   clutter_input_device_update_from_event (device, &c_event);
- *
- *   clutter_do_event (&c_event);
- * ]|
- *
- * The @update_stage boolean argument should be used when the input device
- * enters and leaves a #ClutterStage; it will use the #ClutterStage field
- * of the passed @event to update the stage associated to the input device.
- *
- * Since: 1.2
- */
-void
-clutter_input_device_update_from_event (ClutterInputDevice *device,
-                                        ClutterEvent       *event)
-{
-  ClutterEventSequence *sequence;
-  gfloat event_x, event_y;
-
-  g_return_if_fail (CLUTTER_IS_INPUT_DEVICE (device));
-  g_return_if_fail (event != NULL);
-
-  sequence = clutter_event_get_event_sequence (event);
-  clutter_event_get_coords (event, &event_x, &event_y);
-
-  _clutter_input_device_set_coords (device, sequence, event_x, event_y);
-}
-
 /*< private >
  * clutter_input_device_reset_axes:
  * @device: a #ClutterInputDevice
diff --git a/src/tests/clutter/performance/test-common.h b/src/tests/clutter/performance/test-common.h
index 32b13d7fa4..31df57ad8f 100644
--- a/src/tests/clutter/performance/test-common.h
+++ b/src/tests/clutter/performance/test-common.h
@@ -110,7 +110,6 @@ static gboolean perf_fake_mouse_cb (gpointer stage)
       event2->crossing.related = NULL;
 
       clutter_event_set_device (event2, device);
-      clutter_input_device_update_from_event (device, event2);
 
       clutter_event_put (event2);
       clutter_event_free (event2);


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