mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +00:00
LibWeb+WebContent: Keep track of screen rect
It is now possible to get the up-to-date screen rect from a Web::Page.
This commit is contained in:
parent
96b26ec125
commit
e8739ddab7
9 changed files with 29 additions and 1 deletions
|
@ -29,6 +29,7 @@
|
|||
#include <AK/String.h>
|
||||
#include <AK/URLParser.h>
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/Desktop.h>
|
||||
#include <LibGUI/InputBox.h>
|
||||
#include <LibGUI/MessageBox.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
|
@ -88,6 +89,7 @@ void OutOfProcessWebView::create_client()
|
|||
};
|
||||
|
||||
client().post_message(Messages::WebContentServer::UpdateSystemTheme(Gfx::current_system_theme_buffer()));
|
||||
client().post_message(Messages::WebContentServer::UpdateScreenRect(GUI::Desktop::the().rect()));
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::load(const URL& url)
|
||||
|
@ -208,6 +210,11 @@ void OutOfProcessWebView::theme_change_event(GUI::ThemeChangeEvent& event)
|
|||
request_repaint();
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::screen_rect_change_event(GUI::ScreenRectChangeEvent& event)
|
||||
{
|
||||
client().post_message(Messages::WebContentServer::UpdateScreenRect(event.rect()));
|
||||
}
|
||||
|
||||
void OutOfProcessWebView::notify_server_did_paint(Badge<WebContentClient>, i32 bitmap_id)
|
||||
{
|
||||
if (m_client_state.back_bitmap_id == bitmap_id) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue