1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 19:45:07 +00:00

LibGUI+WindowServer: Create and broadcast an event when a window moves

LibWeb's Window object will need to know the OS-level position and size
of the GUI::Window for e.g. screenX, screenY, outerWidth, outerHeight.
It will also need to know about changes to that data.
This commit is contained in:
Timothy Flynn 2022-11-01 14:23:22 -04:00 committed by Linus Groh
parent 6b41da0b9e
commit f7e747b68e
7 changed files with 47 additions and 0 deletions

View file

@ -102,6 +102,12 @@ void ConnectionToWindowServer::window_resized(i32 window_id, Gfx::IntRect const&
}
}
void ConnectionToWindowServer::window_moved(i32 window_id, Gfx::IntRect const& new_rect)
{
if (auto* window = Window::from_window_id(window_id))
Core::EventLoop::current().post_event(*window, make<MoveEvent>(new_rect.location()));
}
void ConnectionToWindowServer::window_activated(i32 window_id)
{
if (auto* window = Window::from_window_id(window_id))