[mutter/wip/carlosg/unthrottled-wayland: 7/24] clutter: Shuffle some clutter-main code




commit 2804ff7125838eb5ba0b3d35b287fc875c82af54
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 f188eb9b7b..eba38f7523 100644
--- a/clutter/clutter/clutter-main.c
+++ b/clutter/clutter/clutter-main.c
@@ -139,10 +139,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)
 {
@@ -1191,6 +1187,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.
@@ -1395,36 +1421,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]