[mutter/wip/carlosg/unthrottled-wayland: 2/14] clutter: Shuffle some clutter-main code




commit 395359a58ed3389bc112597b8e1daf6e71da3276
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 60beebc730..9f56a0123b 100644
--- a/clutter/clutter/clutter-main.c
+++ b/clutter/clutter/clutter-main.c
@@ -138,10 +138,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)
 {
@@ -1190,6 +1186,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.
@@ -1389,36 +1415,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]