mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 17:15:26 +00:00
WindowServer: Add Optional<Gfx::IntRect> argument to get_screen_bitmap()
This way, we can optionally specify a region of the display to capture. Defaults to entire screen if no rectangle is given.
This commit is contained in:
committed by
Linus Groh
parent
cb74f7992a
commit
4864ef9440
@@ -863,8 +863,12 @@ void ClientConnection::did_become_responsive()
|
||||
set_unresponsive(false);
|
||||
}
|
||||
|
||||
Messages::WindowServer::GetScreenBitmapResponse ClientConnection::get_screen_bitmap()
|
||||
Messages::WindowServer::GetScreenBitmapResponse ClientConnection::get_screen_bitmap(Optional<Gfx::IntRect> const& rect)
|
||||
{
|
||||
if (rect.has_value()) {
|
||||
auto bitmap = Compositor::the().front_bitmap_for_screenshot({}).cropped(rect.value());
|
||||
return bitmap->to_shareable_bitmap();
|
||||
}
|
||||
auto& bitmap = Compositor::the().front_bitmap_for_screenshot({});
|
||||
return bitmap.to_shareable_bitmap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user