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



commit 506b75fc7f3a1beeee6141ccb8edb6731c45cc6a
Author: Robert Mader <robert mader posteo de>
Date:   Sat Sep 14 19:24:36 2019 +0200

    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.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/728

 src/shell-util.c | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/src/shell-util.c b/src/shell-util.c
index 3f57ada8d5..e94f3c364d 100644
--- a/src/shell-util.c
+++ b/src/shell-util.c
@@ -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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]