Commit 506b75fc authored by Robert Mader's avatar Robert Mader Committed by Jonas Ådahl

shell-util: Do not scale the clip in get_content_for_window_actor()

This is now handled in Mutter. Also, respect the result size instead
of assuming it to be equal to the clip size, as the clip takes actor
coordinates while the result takes buffer coordinates.

This can be fixed in a future API iteration.

!728
parent a0d0a17d
Pipeline #116818 passed with stages
in 25 minutes and 46 seconds
......@@ -429,28 +429,20 @@ shell_util_get_content_for_window_actor (MetaWindowActor *window_actor,
cairo_surface_t *surface;
cairo_rectangle_int_t clip;
gfloat actor_x, actor_y;
gfloat resource_scale;
clutter_actor_get_position (CLUTTER_ACTOR (window_actor), &actor_x, &actor_y);
if (!clutter_actor_get_resource_scale (CLUTTER_ACTOR (window_actor),
&resource_scale))
{
resource_scale = 1.0;
g_warning ("Actor resource scale is not know at this point, "
"falling back to default 1.0");
}
clip.x = window_rect->x - (gint) actor_x;
clip.y = window_rect->y - (gint) actor_y;
clip.width = ceilf (window_rect->width * resource_scale);
clip.height = ceilf (window_rect->height * resource_scale);
clip.width = window_rect->width;
clip.height = window_rect->height;
surface = meta_window_actor_get_image (window_actor, &clip);
content = clutter_canvas_new ();
clutter_canvas_set_size (CLUTTER_CANVAS (content),
clip.width, clip.height);
cairo_image_surface_get_width (surface),
cairo_image_surface_get_height (surface));
g_signal_connect (content, "draw",
G_CALLBACK (canvas_draw_cb), surface);
clutter_content_invalidate (content);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment