mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 07:07:23 +00:00
LibGUI+WindowServer: Allow applications to set custom cursor bitmaps
This will allow e.g PaintBrush to use custom cursors for each tool.
This commit is contained in:
committed by
Andreas Kling
parent
8c1b01e79b
commit
df43e09433
@@ -578,6 +578,25 @@ OwnPtr<Messages::WindowServer::SetWindowOverrideCursorResponse> ClientConnection
|
||||
return make<Messages::WindowServer::SetWindowOverrideCursorResponse>();
|
||||
}
|
||||
|
||||
OwnPtr<Messages::WindowServer::SetWindowCustomOverrideCursorResponse> ClientConnection::handle(const Messages::WindowServer::SetWindowCustomOverrideCursor& message)
|
||||
{
|
||||
auto it = m_windows.find(message.window_id());
|
||||
if (it == m_windows.end()) {
|
||||
did_misbehave("SetWindowCustomOverrideCursor: Bad window ID");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto& window = *(*it).value;
|
||||
if (!message.cursor().is_valid()) {
|
||||
did_misbehave("SetWindowCustomOverrideCursor: Bad cursor");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
window.set_override_cursor(Cursor::create(*message.cursor().bitmap()));
|
||||
Compositor::the().invalidate_cursor();
|
||||
return make<Messages::WindowServer::SetWindowCustomOverrideCursorResponse>();
|
||||
}
|
||||
|
||||
OwnPtr<Messages::WindowServer::SetWindowHasAlphaChannelResponse> ClientConnection::handle(const Messages::WindowServer::SetWindowHasAlphaChannel& message)
|
||||
{
|
||||
auto it = m_windows.find(message.window_id());
|
||||
|
||||
Reference in New Issue
Block a user