mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:07:47 +00:00
WindowServer: Add an IPC call for taking a screenshot
This patch adds Messages::WindowServer::GetScreenBitmap. It returns the currently displayed on-screen bitmap as-is, as a Gfx::ShareableBitmap.
This commit is contained in:
parent
557927f25b
commit
d9f8f6a2d0
4 changed files with 11 additions and 0 deletions
|
@ -987,4 +987,10 @@ void ClientConnection::did_become_responsive()
|
||||||
set_unresponsive(false);
|
set_unresponsive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OwnPtr<Messages::WindowServer::GetScreenBitmapResponse> ClientConnection::handle(const Messages::WindowServer::GetScreenBitmap&)
|
||||||
|
{
|
||||||
|
auto& bitmap = Compositor::the().front_bitmap_for_screenshot({});
|
||||||
|
return make<Messages::WindowServer::GetScreenBitmapResponse>(bitmap.to_shareable_bitmap());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,6 +167,7 @@ private:
|
||||||
virtual OwnPtr<Messages::WindowServer::GetMouseAccelerationResponse> handle(const Messages::WindowServer::GetMouseAcceleration&) override;
|
virtual OwnPtr<Messages::WindowServer::GetMouseAccelerationResponse> handle(const Messages::WindowServer::GetMouseAcceleration&) override;
|
||||||
virtual OwnPtr<Messages::WindowServer::SetScrollStepSizeResponse> handle(const Messages::WindowServer::SetScrollStepSize&) override;
|
virtual OwnPtr<Messages::WindowServer::SetScrollStepSizeResponse> handle(const Messages::WindowServer::SetScrollStepSize&) override;
|
||||||
virtual OwnPtr<Messages::WindowServer::GetScrollStepSizeResponse> handle(const Messages::WindowServer::GetScrollStepSize&) override;
|
virtual OwnPtr<Messages::WindowServer::GetScrollStepSizeResponse> handle(const Messages::WindowServer::GetScrollStepSize&) override;
|
||||||
|
virtual OwnPtr<Messages::WindowServer::GetScreenBitmapResponse> handle(const Messages::WindowServer::GetScreenBitmap&) override;
|
||||||
|
|
||||||
Window* window_from_id(i32 window_id);
|
Window* window_from_id(i32 window_id);
|
||||||
|
|
||||||
|
|
|
@ -76,6 +76,8 @@ public:
|
||||||
|
|
||||||
void did_construct_window_manager(Badge<WindowManager>);
|
void did_construct_window_manager(Badge<WindowManager>);
|
||||||
|
|
||||||
|
const Gfx::Bitmap& front_bitmap_for_screenshot(Badge<ClientConnection>) const { return *m_front_bitmap; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Compositor();
|
Compositor();
|
||||||
void init_bitmaps();
|
void init_bitmaps();
|
||||||
|
|
|
@ -123,5 +123,7 @@ endpoint WindowServer = 2
|
||||||
SetScrollStepSize(u32 step_size) => ()
|
SetScrollStepSize(u32 step_size) => ()
|
||||||
GetScrollStepSize() => (u32 step_size)
|
GetScrollStepSize() => (u32 step_size)
|
||||||
|
|
||||||
|
GetScreenBitmap() => (Gfx::ShareableBitmap bitmap)
|
||||||
|
|
||||||
Pong() =|
|
Pong() =|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue