summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2020-04-16 19:42:03 +0200
committerJonas Ådahl <jadahl@gmail.com>2020-05-26 16:35:00 +0200
commitb8003807b0772e97354302b5cc2825e0b22c6c83 (patch)
treee6234221fe136a8472f708437c8e5b6aae1109d2
parent8e1bd64e05c3098fcce4f916f9e4468decb8f30c (diff)
downloadmutter-b8003807b0772e97354302b5cc2825e0b22c6c83.tar.gz
clutter/stage: Make clutter_stage_schedule_update() always schedule
We could call clutter_stage_schedule_update() and it wouldn't actually schedule anything, as the master frame clock only tries to reschedule if 1) there is an active timeline, 2) there are pending relayouts, 3) there are pending redraws, or 4) there are pending events. Thus, a call to clutter_stage_schedule_update() didn't have any effect if it was called at the wrong time. Fix this by adding a boolean state "needs_update" to the stage, set on clutter_stage_schedule_update() and cleared on _clutter_stage_do_update(), that will make the master clock reschedule an update if it is TRUE. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1218
-rw-r--r--clutter/clutter/clutter-stage.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index ca0ab44de..7aa46517c 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -142,6 +142,8 @@ struct _ClutterStagePrivate
int update_freeze_count;
+ gboolean needs_update;
+
guint redraw_pending : 1;
guint throttle_motion_events : 1;
guint min_size_changed : 1;
@@ -1308,7 +1310,9 @@ _clutter_stage_needs_update (ClutterStage *stage)
priv = stage->priv;
- return priv->redraw_pending || g_hash_table_size (priv->pending_relayouts) > 0;
+ return (priv->redraw_pending ||
+ priv->needs_update ||
+ g_hash_table_size (priv->pending_relayouts) > 0);
}
void
@@ -1499,6 +1503,8 @@ _clutter_stage_do_update (ClutterStage *stage)
priv->stage_was_relayout = FALSE;
+ priv->needs_update = FALSE;
+
/* if the stage is being destroyed, or if the destruction already
* happened and we don't have an StageWindow any more, then we
* should bail out
@@ -3453,6 +3459,8 @@ _clutter_stage_schedule_update (ClutterStage *stage)
if (stage_window == NULL)
return;
+ stage->priv->needs_update = TRUE;
+
return _clutter_stage_window_schedule_update (stage_window,
stage->priv->sync_delay);
}