Skip to content

Commit

Permalink
ScreenshotManager: Use get_image from actor directly (#1957)
Browse files Browse the repository at this point in the history
Co-authored-by: Leonhard <[email protected]>
  • Loading branch information
tintou and leolost2605 authored Jul 6, 2024
1 parent 3a81898 commit d0609ab
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ScreenshotManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ namespace Gala {
}

var window_actor = (Meta.WindowActor) window.get_compositor_private ();
unowned Meta.ShapedTexture window_texture = (Meta.ShapedTexture) window_actor.get_texture ();

float actor_x, actor_y;
window_actor.get_position (out actor_x, out actor_y);
Expand All @@ -162,8 +161,14 @@ namespace Gala {
#else
Cairo.RectangleInt clip = { rect.x - (int) actor_x, rect.y - (int) actor_y, rect.width, rect.height };
#endif
var image = (Cairo.ImageSurface) window_texture.get_image (clip);
var image = (Cairo.ImageSurface) window_actor.get_image (clip);
if (include_cursor) {
if (window.get_client_type () == Meta.WindowClientType.WAYLAND) {
float resource_scale = window_actor.get_resource_scale ();

image.set_device_scale (resource_scale, resource_scale);
}

image = composite_stage_cursor (image, { rect.x, rect.y, rect.width, rect.height });
}

Expand Down

0 comments on commit d0609ab

Please sign in to comment.