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

WindowServer+LibGUI: Allow changing a window's base size and increment

Previously it was only possible to change these window attributes when
creating a new window. This patch adds an IPC message that allows you
to change them at runtime.
This commit is contained in:
Andreas Kling 2020-02-24 19:23:57 +01:00
parent d0f5b43c2e
commit ab6f694905
5 changed files with 38 additions and 2 deletions

View file

@ -714,4 +714,19 @@ void ClientConnection::deboost()
perror("deboost: set_process_boost");
}
OwnPtr<Messages::WindowServer::SetWindowBaseSizeAndSizeIncrementResponse> ClientConnection::handle(const Messages::WindowServer::SetWindowBaseSizeAndSizeIncrement& message)
{
auto it = m_windows.find(message.window_id());
if (it == m_windows.end()) {
did_misbehave("SetWindowBaseSizeAndSizeIncrementResponse: Bad window ID");
return nullptr;
}
auto& window = *it->value;
window.set_base_size(message.base_size());
window.set_size_increment(message.size_increment());
return make<Messages::WindowServer::SetWindowBaseSizeAndSizeIncrementResponse>();
}
}