window-group: Fix issues when translated

It seems that when translated, paint_offset and actor_offset will always
be the same, so our translation of the clip group won't work. For now,
until I figure out what's going on here, just use the painting offset,
since that what seems to make sense to me.

I didn't write this code, though, so I don't know why the actor's
allocation was involved in this computation at all.

I tested briefly with clones (magnifier, manual cloning through the
looking glass) and couldn't find any other artifacts, so I'm going to do
this for now.
This commit is contained in:
Jasper St. Pierre 2015-07-05 23:55:43 -07:00
parent 9fc1c919e8
commit 2705c87f74

View File

@ -58,9 +58,7 @@ meta_window_group_paint (ClutterActor *actor)
cairo_region_t *clip_region; cairo_region_t *clip_region;
cairo_region_t *unobscured_region; cairo_region_t *unobscured_region;
cairo_rectangle_int_t visible_rect, clip_rect; cairo_rectangle_int_t visible_rect, clip_rect;
int paint_x_offset, paint_y_offset;
int paint_x_origin, paint_y_origin; int paint_x_origin, paint_y_origin;
int actor_x_origin, actor_y_origin;
int screen_width, screen_height; int screen_width, screen_height;
MetaWindowGroup *window_group = META_WINDOW_GROUP (actor); MetaWindowGroup *window_group = META_WINDOW_GROUP (actor);
@ -82,7 +80,7 @@ meta_window_group_paint (ClutterActor *actor)
* on the stage. * on the stage.
*/ */
if (!meta_actor_painting_untransformed (screen_width, screen_height, &paint_x_origin, &paint_y_origin) || if (!meta_actor_painting_untransformed (screen_width, screen_height, &paint_x_origin, &paint_y_origin) ||
!meta_actor_is_untransformed (actor, &actor_x_origin, &actor_y_origin)) !meta_actor_is_untransformed (actor, NULL, NULL))
{ {
CLUTTER_ACTOR_CLASS (meta_window_group_parent_class)->paint (actor); CLUTTER_ACTOR_CLASS (meta_window_group_parent_class)->paint (actor);
return; return;
@ -105,9 +103,7 @@ meta_window_group_paint (ClutterActor *actor)
clip_region = cairo_region_create_rectangle (&clip_rect); clip_region = cairo_region_create_rectangle (&clip_rect);
paint_x_offset = paint_x_origin - actor_x_origin; cairo_region_translate (clip_region, -paint_x_origin, -paint_y_origin);
paint_y_offset = paint_y_origin - actor_y_origin;
cairo_region_translate (clip_region, -paint_x_offset, -paint_y_offset);
meta_cullable_cull_out (META_CULLABLE (window_group), unobscured_region, clip_region); meta_cullable_cull_out (META_CULLABLE (window_group), unobscured_region, clip_region);