[mutter/wip/carlosg/unthrottled-wayland: 222/240] clutter: Shuffle some clutter-main code




commit 98a85728e1e4f740df38fc537af5b14f0cf17ecb
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Jun 4 12:06:43 2021 +0200

    clutter: Shuffle some clutter-main code
    
    Move update_device_for_event() definition above the only point
    it's now called.

 clutter/clutter/clutter-main.c | 64 ++++++++++++++++++++----------------------
 1 file changed, 30 insertions(+), 34 deletions(-)
---
diff --git a/clutter/clutter/clutter-main.c b/clutter/clutter/clutter-main.c
index 94b13a38c2..98091c243f 100644
--- a/clutter/clutter/clutter-main.c
+++ b/clutter/clutter/clutter-main.c
@@ -136,10 +136,6 @@ static const GDebugKey clutter_paint_debug_keys[] = {
   { "max-render-time", CLUTTER_DEBUG_PAINT_MAX_RENDER_TIME },
 };
 
-static ClutterActor * update_device_for_event (ClutterStage *stage,
-                                               ClutterEvent *event,
-                                               gboolean      emit_crossing);
-
 gboolean
 _clutter_context_get_show_fps (void)
 {
@@ -763,6 +759,36 @@ process_key_event (ClutterEvent       *event,
     emit_event_chain (event);
 }
 
+static ClutterActor *
+update_device_for_event (ClutterStage *stage,
+                         ClutterEvent *event,
+                         gboolean      emit_crossing)
+{
+  ClutterInputDevice *device = clutter_event_get_device (event);
+  ClutterEventSequence *sequence = clutter_event_get_event_sequence (event);
+  ClutterActor *new_actor;
+  graphene_point_t point;
+  uint32_t time_ms;
+
+  clutter_event_get_coords (event, &point.x, &point.y);
+  time_ms = clutter_event_get_time (event);
+
+  new_actor =
+    _clutter_stage_do_pick (stage, point.x, point.y, CLUTTER_PICK_REACTIVE);
+
+  /* Picking should never fail, but if it does, we bail out here */
+  g_return_val_if_fail (new_actor != NULL, NULL);
+
+  clutter_stage_update_device (stage,
+                               device, sequence,
+                               point,
+                               time_ms,
+                               new_actor,
+                               emit_crossing);
+
+  return new_actor;
+}
+
 /**
  * clutter_do_event:
  * @event: a #ClutterEvent.
@@ -967,36 +993,6 @@ clutter_stage_repick_device (ClutterStage       *stage,
                                TRUE);
 }
 
-static ClutterActor *
-update_device_for_event (ClutterStage *stage,
-                         ClutterEvent *event,
-                         gboolean      emit_crossing)
-{
-  ClutterInputDevice *device = clutter_event_get_device (event);
-  ClutterEventSequence *sequence = clutter_event_get_event_sequence (event);
-  ClutterActor *new_actor;
-  graphene_point_t point;
-  uint32_t time;
-
-  clutter_event_get_coords (event, &point.x, &point.y);
-  time = clutter_event_get_time (event);
-
-  new_actor =
-    _clutter_stage_do_pick (stage, point.x, point.y, CLUTTER_PICK_REACTIVE);
-
-  /* Picking should never fail, but if it does, we bail out here */
-  g_return_val_if_fail (new_actor != NULL, NULL);
-
-  clutter_stage_update_device (stage,
-                               device, sequence,
-                               point,
-                               time,
-                               new_actor,
-                               emit_crossing);
-
-  return new_actor;
-}
-
 static void
 remove_device_for_event (ClutterStage *stage,
                          ClutterEvent *event,


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