mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-17 13:17:33 +00:00
LibGUI: Add ScreenRectChangeEvent and deliver it to windows and widgets
Having to rely on GUI::Desktop's on_rect_change is quite limiting and a bit awkward (continuing to use it would mean having to setup the callback in every application using a webview) - we need a better way of letting widgets know of a screen rect change automatically. The specific use case will be IPWV/OOPWV which need to keep track of the screen rect and notify the WebContent service of any change (which on its own deliberately can't interact with WindowServer at all). It'll also be useful for notification windows and the taskbar, which currently both rely on the GUI::Desktop callback but will now be able to listen and react to the event themselves.
This commit is contained in:
committed by
Andreas Kling
parent
a5db11c1f0
commit
5367bbb82c
@@ -297,6 +297,9 @@ void WindowServerConnection::handle(const Messages::WindowClient::WM_WindowRemov
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::ScreenRectChanged& message)
|
||||
{
|
||||
Desktop::the().did_receive_screen_rect({}, message.rect());
|
||||
Window::for_each_window({}, [message](auto& window) {
|
||||
Core::EventLoop::current().post_event(window, make<ScreenRectChangeEvent>(message.rect()));
|
||||
});
|
||||
}
|
||||
|
||||
void WindowServerConnection::handle(const Messages::WindowClient::AsyncSetWallpaperFinished&)
|
||||
|
||||
Reference in New Issue
Block a user