Fix up for latest Clutter deprecations

https://bugzilla.gnome.org/show_bug.cgi?id=678917
This commit is contained in:
Jasper St. Pierre
2012-01-17 09:16:46 -05:00
parent 2aea49a8d0
commit d395d75e26
4 changed files with 41 additions and 43 deletions

View File

@@ -575,13 +575,11 @@ meta_compositor_manage_screen (MetaCompositor *compositor,
info->window_group = meta_window_group_new (screen);
info->top_window_group = meta_window_group_new (screen);
info->overlay_group = clutter_group_new ();
info->overlay_group = clutter_actor_new ();
clutter_container_add (CLUTTER_CONTAINER (info->stage),
info->window_group,
info->top_window_group,
info->overlay_group,
NULL);
clutter_actor_add_child (info->stage, info->window_group);
clutter_actor_add_child (info->stage, info->top_window_group);
clutter_actor_add_child (info->stage, info->overlay_group);
info->plugin_mgr = meta_plugin_manager_new (screen);
@@ -1039,7 +1037,7 @@ sync_actor_stacking (MetaCompScreen *info)
* little effort to make sure we actually need to restack before
* we go ahead and do it */
children = clutter_container_get_children (CLUTTER_CONTAINER (info->window_group));
children = clutter_actor_get_children (info->window_group);
reordered = FALSE;
/* We allow for actors in the window group other than the actors we
@@ -1086,9 +1084,10 @@ sync_actor_stacking (MetaCompScreen *info)
* windows first, then background */
for (tmp = g_list_last (info->windows); tmp != NULL; tmp = tmp->prev)
{
MetaWindowActor *window_actor = tmp->data;
ClutterActor *actor = tmp->data;
clutter_actor_lower_bottom (CLUTTER_ACTOR (window_actor));
if (clutter_actor_get_parent (actor) == info->window_group)
clutter_actor_set_child_below_sibling (info->window_group, actor, NULL);
}
/* we prepended the backgrounds above so the last actor in the list
@@ -1098,7 +1097,8 @@ sync_actor_stacking (MetaCompScreen *info)
{
ClutterActor *actor = tmp->data;
clutter_actor_lower_bottom (CLUTTER_ACTOR (actor));
if (clutter_actor_get_parent (actor) == info->window_group)
clutter_actor_set_child_below_sibling (info->window_group, actor, NULL);
}
g_list_free (backgrounds);
}
@@ -1481,45 +1481,44 @@ meta_enable_unredirect_for_screen (MetaScreen *screen)
#define FLASH_TIME_MS 50
static void
flash_out_completed (ClutterAnimation *animation,
ClutterActor *flash)
flash_out_completed (ClutterTimeline *timeline,
gpointer user_data)
{
ClutterActor *flash = CLUTTER_ACTOR (user_data);
clutter_actor_destroy (flash);
}
static void
flash_in_completed (ClutterAnimation *animation,
ClutterActor *flash)
{
clutter_actor_animate (flash, CLUTTER_EASE_IN_QUAD,
FLASH_TIME_MS,
"opacity", 0,
"signal-after::completed", flash_out_completed, flash,
NULL);
}
void
meta_compositor_flash_screen (MetaCompositor *compositor,
MetaScreen *screen)
{
ClutterActor *stage;
ClutterActor *flash;
ClutterColor black = { 0, 0, 0, 255 };
ClutterTransition *transition;
gfloat width, height;
stage = meta_get_stage_for_screen (screen);
clutter_actor_get_size (stage, &width, &height);
flash = clutter_rectangle_new_with_color (&black);
flash = clutter_actor_new ();
clutter_actor_set_background_color (flash, CLUTTER_COLOR_Black);
clutter_actor_set_size (flash, width, height);
clutter_actor_set_opacity (flash, 0);
clutter_container_add_actor (CLUTTER_CONTAINER (stage), flash);
clutter_actor_add_child (stage, flash);
clutter_actor_animate (flash, CLUTTER_EASE_OUT_QUAD,
FLASH_TIME_MS,
"opacity", 192,
"signal-after::completed", flash_in_completed, flash,
NULL);
clutter_actor_save_easing_state (flash);
clutter_actor_set_easing_mode (flash, CLUTTER_EASE_IN_QUAD);
clutter_actor_set_easing_duration (flash, FLASH_TIME_MS);
clutter_actor_set_opacity (flash, 192);
transition = clutter_actor_get_transition (flash, "opacity");
clutter_timeline_set_auto_reverse (CLUTTER_TIMELINE (transition), TRUE);
clutter_timeline_set_repeat_count (CLUTTER_TIMELINE (transition), 2);
g_signal_connect (transition, "finished",
G_CALLBACK (flash_out_completed), flash);
clutter_actor_restore_easing_state (flash);
}
/**