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

Taskbar: Update and clear taskbar button rectangles

We need to update all button rectangles when the layout changed.
We also need to clear the taskbar button rectangle when we
remove a modal window button, so that WindowServer uses the
parent's taskbar button rectangle for the minimize animation.
This commit is contained in:
Tom 2020-08-18 13:35:34 -06:00 committed by Andreas Kling
parent 2552e3be00
commit 4897eb8c3e
4 changed files with 33 additions and 4 deletions

View file

@ -47,13 +47,27 @@ void TaskbarButton::context_menu_event(GUI::ContextMenuEvent&)
GUI::WindowServerConnection::the().post_message(Messages::WindowServer::WM_PopupWindowMenu(m_identifier.client_id(), m_identifier.window_id(), screen_relative_rect().location()));
}
void TaskbarButton::resize_event(GUI::ResizeEvent& event)
void TaskbarButton::update_taskbar_rect()
{
GUI::WindowServerConnection::the().post_message(
Messages::WindowServer::WM_SetWindowTaskbarRect(
m_identifier.client_id(),
m_identifier.window_id(),
screen_relative_rect()));
}
void TaskbarButton::clear_taskbar_rect()
{
GUI::WindowServerConnection::the().post_message(
Messages::WindowServer::WM_SetWindowTaskbarRect(
m_identifier.client_id(),
m_identifier.window_id(),
{}));
}
void TaskbarButton::resize_event(GUI::ResizeEvent& event)
{
update_taskbar_rect();
return GUI::Button::resize_event(event);
}