mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:07:34 +00:00
WindowServer: Add support for alpha channel based hit testing
This enables implementing non-rectangular window shapes, including non-rectangular window frames.
This commit is contained in:
parent
b3f0a5c917
commit
d590e0c946
12 changed files with 107 additions and 12 deletions
|
@ -463,6 +463,7 @@ OwnPtr<Messages::WindowServer::CreateWindowResponse> ClientConnection::handle(co
|
|||
window->recalculate_rect();
|
||||
}
|
||||
window->set_opacity(message.opacity());
|
||||
window->set_alpha_hit_threshold(message.alpha_hit_threshold());
|
||||
window->set_size_increment(message.size_increment());
|
||||
window->set_base_size(message.base_size());
|
||||
window->set_resize_aspect_ratio(message.resize_aspect_ratio());
|
||||
|
@ -636,6 +637,17 @@ OwnPtr<Messages::WindowServer::SetWindowHasAlphaChannelResponse> ClientConnectio
|
|||
return make<Messages::WindowServer::SetWindowHasAlphaChannelResponse>();
|
||||
}
|
||||
|
||||
OwnPtr<Messages::WindowServer::SetWindowAlphaHitThresholdResponse> ClientConnection::handle(const Messages::WindowServer::SetWindowAlphaHitThreshold& message)
|
||||
{
|
||||
auto it = m_windows.find(message.window_id());
|
||||
if (it == m_windows.end()) {
|
||||
did_misbehave("SetWindowAlphaHitThreshold: Bad window ID");
|
||||
return {};
|
||||
}
|
||||
it->value->set_alpha_hit_threshold(message.threshold());
|
||||
return make<Messages::WindowServer::SetWindowAlphaHitThresholdResponse>();
|
||||
}
|
||||
|
||||
void ClientConnection::handle(const Messages::WindowServer::WM_SetActiveWindow& message)
|
||||
{
|
||||
auto* client = ClientConnection::from_client_id(message.client_id());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue