From 3944daf3c001a7fdf9be316718f91f1a4f9adb64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Sat, 4 Apr 2020 01:20:08 +0200 Subject: [PATCH] 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 --- clutter/clutter/clutter-stage.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c index aabf302ff..d50fd37f0 100644 --- a/clutter/clutter/clutter-stage.c +++ b/clutter/clutter/clutter-stage.c @@ -1402,11 +1402,8 @@ gboolean _clutter_stage_do_update (ClutterStage *stage) { ClutterStagePrivate *priv = stage->priv; - gboolean stage_was_relayout = priv->stage_was_relayout; GSList *devices = NULL; - priv->stage_was_relayout = FALSE; - priv->needs_update = FALSE; /* 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) return FALSE; - if (stage_was_relayout) - devices = clutter_stage_find_updated_devices (stage); - update_actor_stage_views (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); /* reset the guard, so that new redraws are possible */