diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c index a11d7666c..9fdd59f36 100644 --- a/clutter/clutter-main.c +++ b/clutter/clutter-main.c @@ -236,18 +236,9 @@ _clutter_do_redraw (ClutterStage *stage) void clutter_redraw (ClutterStage *stage) { - ClutterMasterClock *master_clock; + g_return_if_fail (CLUTTER_IS_STAGE (stage)); - /* we need to do this because the clutter_redraw() might be called by - * clutter-gtk, and this will not cause the master clock to advance nor - * the repaint functions to be run - */ - master_clock = _clutter_master_clock_get_default (); - _clutter_master_clock_advance (master_clock); - - _clutter_run_repaint_functions (); - - _clutter_do_redraw (stage); + clutter_stage_ensure_redraw (stage); } /** diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index 5a6d94c2c..2627169e1 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -1946,6 +1946,33 @@ clutter_stage_ensure_viewport (ClutterStage *stage) clutter_actor_queue_redraw (CLUTTER_ACTOR (stage)); } +/** + * clutter_stage_ensure_redraw: + * @stage: a #ClutterStage + * + * Ensures that @stage is redrawn + * + * This function should not be called by applications: it is + * used when embedding a #ClutterStage into a toolkit with + * another windowing system, like GTK+. + * + * Since: 1.0 + */ +void +clutter_stage_ensure_redraw (ClutterStage *stage) +{ + ClutterMasterClock *master_clock; + ClutterStagePrivate *priv; + + g_return_if_fail (CLUTTER_IS_STAGE (stage)); + + priv = stage->priv; + priv->redraw_pending = TRUE; + + master_clock = _clutter_master_clock_get_default (); + _clutter_master_clock_start_running (master_clock); +} + /** * clutter_stage_queue_redraw: * @stage: the #ClutterStage diff --git a/clutter/clutter-stage.h b/clutter/clutter-stage.h index 2b7e836bb..380ee85d0 100644 --- a/clutter/clutter-stage.h +++ b/clutter/clutter-stage.h @@ -243,6 +243,7 @@ void clutter_stage_ensure_current (ClutterStage *stage); void clutter_stage_queue_redraw (ClutterStage *stage); gboolean clutter_stage_is_default (ClutterStage *stage); void clutter_stage_ensure_viewport (ClutterStage *stage); +void clutter_stage_ensure_redraw (ClutterStage *stage); /* Commodity macro */ #define clutter_stage_add(stage,actor) G_STMT_START { \ diff --git a/doc/reference/clutter/clutter-sections.txt b/doc/reference/clutter/clutter-sections.txt index 10d971b41..b5f65e08b 100644 --- a/doc/reference/clutter/clutter-sections.txt +++ b/doc/reference/clutter/clutter-sections.txt @@ -485,6 +485,7 @@ ClutterPickMode clutter_stage_get_actor_at_pos clutter_stage_ensure_current clutter_stage_ensure_viewport +clutter_stage_ensure_redraw clutter_stage_queue_redraw clutter_stage_event clutter_stage_set_key_focus