mirror of
https://github.com/elementary/gala.git
synced 2024-11-27 07:38:47 +03:00
ScreenshotManager: Use get_image from actor directly (#1957)
Co-authored-by: Leonhard <106322251+leolost2605@users.noreply.github.com>
This commit is contained in:
parent
3a81898095
commit
d0609ab6b3
@ -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);
|
||||
@ -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 });
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user