clutter/stage: Find devices to update after finish queue redraw

Devices are updated (repicked) as part of the stage update phase, as
their stacking, position and transform might have changed since since
the last update.

The redraw clip was used to avoid unnecessary updating of devices, if
the device in question had it's position outside of the redraw clip. If
the device coordinate was outside of the redraw clip, what was
underneith the device couldn't have changed.

What it failed to do, however, was to update devices if a relayout had
happened in the same update, as it checked the state whether a layout
had happened before attempting to do a relayout, effectively delaying
the device updating to the next update.

This commit changes the behavior to always update the device given the
complete redraw clip caused by all possible relayouts of the same update
as the device update happens in.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285
This commit is contained in:
Jonas Ådahl 2020-04-04 01:20:08 +02:00
parent b45cea301e
commit 3944daf3c0

View File

@ -1402,11 +1402,8 @@ gboolean
_clutter_stage_do_update (ClutterStage *stage) _clutter_stage_do_update (ClutterStage *stage)
{ {
ClutterStagePrivate *priv = stage->priv; ClutterStagePrivate *priv = stage->priv;
gboolean stage_was_relayout = priv->stage_was_relayout;
GSList *devices = NULL; GSList *devices = NULL;
priv->stage_was_relayout = FALSE;
priv->needs_update = FALSE; priv->needs_update = FALSE;
/* if the stage is being destroyed, or if the destruction already /* if the stage is being destroyed, or if the destruction already
@ -1430,12 +1427,16 @@ _clutter_stage_do_update (ClutterStage *stage)
if (!priv->redraw_pending) if (!priv->redraw_pending)
return FALSE; return FALSE;
if (stage_was_relayout)
devices = clutter_stage_find_updated_devices (stage);
update_actor_stage_views (stage); update_actor_stage_views (stage);
clutter_stage_maybe_finish_queue_redraws (stage); clutter_stage_maybe_finish_queue_redraws (stage);
if (priv->stage_was_relayout)
{
priv->stage_was_relayout = FALSE;
devices = clutter_stage_find_updated_devices (stage);
}
clutter_stage_do_redraw (stage); clutter_stage_do_redraw (stage);
/* reset the guard, so that new redraws are possible */ /* reset the guard, so that new redraws are possible */