1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:58:12 +00:00

Browser+LibWebView: Add a Tab hook to take a screenshot

This commit is contained in:
Timothy Flynn 2022-11-02 12:58:22 -04:00 committed by Linus Groh
parent 819598aecf
commit d603585802
4 changed files with 14 additions and 0 deletions

View file

@ -585,6 +585,13 @@ void OutOfProcessWebView::set_window_size(Gfx::IntSize const& size)
client().async_set_window_size(size);
}
Gfx::ShareableBitmap OutOfProcessWebView::take_screenshot() const
{
if (auto* bitmap = m_client_state.has_usable_bitmap ? m_client_state.front_bitmap.bitmap.ptr() : m_backup_bitmap.ptr())
return bitmap->to_shareable_bitmap();
return {};
}
void OutOfProcessWebView::focusin_event(GUI::FocusEvent&)
{
client().async_set_has_focus(true);