1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +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

@ -670,4 +670,22 @@ Action* Window::action_for_key_event(const KeyEvent& event)
return found_action;
}
void Window::set_base_size(const Gfx::Size& base_size)
{
if (m_base_size == base_size)
return;
m_base_size = base_size;
if (m_window_id)
WindowServerConnection::the().send_sync<Messages::WindowServer::SetWindowBaseSizeAndSizeIncrement>(m_window_id, m_base_size, m_size_increment);
}
void Window::set_size_increment(const Gfx::Size& size_increment)
{
if (m_size_increment == size_increment)
return;
m_size_increment = size_increment;
if (m_window_id)
WindowServerConnection::the().send_sync<Messages::WindowServer::SetWindowBaseSizeAndSizeIncrement>(m_window_id, m_base_size, m_size_increment);
}
}