window-group: Translate background's visible region as necessary

Currently when the window group is moved, the visible region set
on the background actor no longer matches the actually visible
region, resulting in flickering around window actors.
Fix by translating the visible region with the window group.

https://bugzilla.gnome.org/show_bug.cgi?id=681221
This commit is contained in:
Tom Beckmann 2012-08-05 18:30:31 +02:00 committed by Florian Müllner
parent d6be75ae99
commit cd0870730f

View File

@ -109,6 +109,7 @@ meta_window_group_paint (ClutterActor *actor)
ClutterActor *stage; ClutterActor *stage;
cairo_rectangle_int_t visible_rect, unredirected_rect; cairo_rectangle_int_t visible_rect, unredirected_rect;
GList *children, *l; GList *children, *l;
gfloat group_x, group_y;
MetaWindowGroup *window_group = META_WINDOW_GROUP (actor); MetaWindowGroup *window_group = META_WINDOW_GROUP (actor);
MetaCompScreen *info = meta_screen_get_compositor_data (window_group->screen); MetaCompScreen *info = meta_screen_get_compositor_data (window_group->screen);
@ -118,6 +119,8 @@ meta_window_group_paint (ClutterActor *actor)
unredirected_window_region = cairo_region_create_rectangle (&unredirected_rect); unredirected_window_region = cairo_region_create_rectangle (&unredirected_rect);
} }
clutter_actor_get_position (CLUTTER_ACTOR (window_group), &group_x, &group_y);
/* We walk the list from top to bottom (opposite of painting order), /* We walk the list from top to bottom (opposite of painting order),
* and subtract the opaque area of each window out of the visible * and subtract the opaque area of each window out of the visible
* region that we pass to the windows below. * region that we pass to the windows below.
@ -190,6 +193,8 @@ meta_window_group_paint (ClutterActor *actor)
else if (META_IS_BACKGROUND_ACTOR (l->data)) else if (META_IS_BACKGROUND_ACTOR (l->data))
{ {
MetaBackgroundActor *background_actor = l->data; MetaBackgroundActor *background_actor = l->data;
cairo_region_translate (visible_region, - group_x, - group_y);
meta_background_actor_set_visible_region (background_actor, visible_region); meta_background_actor_set_visible_region (background_actor, visible_region);
} }
} }