clutter: Defer repick on transform changes

Avoid an immediate repick, and queue it instead so it happens
for all devices on the next frame clock step.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3385>
This commit is contained in:
Carlos Garnacho 2023-11-10 00:28:42 +01:00 committed by Marge Bot
parent c1feb2dc40
commit 9f00572762
3 changed files with 11 additions and 15 deletions

View File

@ -960,7 +960,7 @@ static void push_in_paint_unmapped_branch (ClutterActor *self,
static void pop_in_paint_unmapped_branch (ClutterActor *self,
guint count);
static void clutter_actor_update_pointer (ClutterActor *self);
static void clutter_actor_update_devices (ClutterActor *self);
static GQuark quark_actor_layout_info = 0;
static GQuark quark_actor_transform_info = 0;
@ -2404,7 +2404,7 @@ update_pointer_if_not_animated (ClutterActor *actor)
{
if (!clutter_actor_has_transitions (actor) &&
!CLUTTER_ACTOR_IN_RELAYOUT (actor))
clutter_actor_update_pointer (actor);
clutter_actor_update_devices (actor);
}
/*< private >
@ -12236,19 +12236,13 @@ clutter_actor_set_animatable_property (ClutterActor *actor,
}
static void
clutter_actor_update_pointer (ClutterActor *self)
clutter_actor_update_devices (ClutterActor *self)
{
ClutterInputDevice *pointer;
ClutterStage *stage;
ClutterSeat *seat;
stage = CLUTTER_STAGE (_clutter_actor_get_stage_internal (self));
if (!stage)
return;
seat = clutter_backend_get_default_seat (clutter_get_default_backend ());
pointer = clutter_seat_get_pointer (seat);
clutter_stage_repick_device (stage, pointer);
if (stage)
clutter_stage_invalidate_devices (stage);
}
static void
@ -12301,7 +12295,7 @@ clutter_actor_set_final_state (ClutterAnimatable *animatable,
}
}
clutter_actor_update_pointer (actor);
clutter_actor_update_devices (actor);
g_free (p_name);
}

View File

@ -168,4 +168,6 @@ ClutterGrab * clutter_stage_grab_input_only (ClutterStage *self,
gpointer user_data,
GDestroyNotify user_data_destroy);
void clutter_stage_invalidate_devices (ClutterStage *stage);
G_END_DECLS

View File

@ -840,8 +840,8 @@ clutter_stage_dequeue_actor_relayout (ClutterStage *stage,
}
}
static void
clutter_stage_invalidate_views_devices (ClutterStage *stage)
void
clutter_stage_invalidate_devices (ClutterStage *stage)
{
GList *l;
@ -900,7 +900,7 @@ clutter_stage_maybe_relayout (ClutterActor *actor)
CLUTTER_NOTE (ACTOR, "<<< Completed recomputing layout of %d subtrees", count);
if (count)
clutter_stage_invalidate_views_devices (stage);
clutter_stage_invalidate_devices (stage);
}
GSList *