1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:07:35 +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:
Linus Groh 2021-04-04 00:02:22 +02:00 committed by Andreas Kling
parent a5db11c1f0
commit 5367bbb82c
7 changed files with 49 additions and 0 deletions

View file

@ -216,6 +216,7 @@ public:
protected:
Window(Core::Object* parent = nullptr);
virtual void wm_event(WMEvent&);
virtual void screen_rect_change_event(ScreenRectChangeEvent&);
private:
void update_cursor();
@ -230,6 +231,7 @@ private:
void handle_became_active_or_inactive_event(Core::Event&);
void handle_close_request();
void handle_theme_change_event(ThemeChangeEvent&);
void handle_screen_rect_change_event(ScreenRectChangeEvent&);
void handle_drag_move_event(DragEvent&);
void handle_left_event();