[mutter/wip/carlosg/unthrottled-wayland: 5/23] clutter: Shuffle some clutter-main code
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/unthrottled-wayland: 5/23] clutter: Shuffle some clutter-main code
- Date: Tue, 7 Dec 2021 18:56:10 +0000 (UTC)
commit 71568d755f488fecc9c3dcef37a2c595c021e873
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.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1915>
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 69a511f5b3..82bb7e4bd0 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)
{
@@ -765,6 +761,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.
@@ -970,36 +996,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]