mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
UI: Send the current system visibility state to new WebContent clients
After a crash, we need to inform the new WebContent process of the current system visibility state.
This commit is contained in:
parent
83b1db785a
commit
957032809b
Notes:
github-actions[bot]
2024-11-13 19:37:42 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/957032809b7 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2318
3 changed files with 8 additions and 2 deletions
|
@ -163,6 +163,8 @@ void WebViewBridge::initialize_client(CreateNewClient create_new_client)
|
|||
|
||||
client().async_set_device_pixels_per_css_pixel(m_client_state.page_index, m_device_pixel_ratio);
|
||||
client().async_set_preferred_color_scheme(m_client_state.page_index, m_preferred_color_scheme);
|
||||
|
||||
set_system_visibility_state(m_system_visibility_state);
|
||||
update_palette();
|
||||
|
||||
if (!m_screen_rects.is_empty()) {
|
||||
|
|
|
@ -136,6 +136,8 @@ HeadlessWebView::HeadlessWebView(Core::AnonymousBuffer theme, Web::DevicePixelSi
|
|||
m_pending_dialog = Web::Page::PendingDialog::None;
|
||||
m_pending_prompt_text.clear();
|
||||
};
|
||||
|
||||
m_system_visibility_state = Web::HTML::VisibilityState::Visible;
|
||||
}
|
||||
|
||||
NonnullOwnPtr<HeadlessWebView> HeadlessWebView::create(Core::AnonymousBuffer theme, Web::DevicePixelSize window_size)
|
||||
|
@ -177,7 +179,7 @@ void HeadlessWebView::initialize_client(CreateNewClient create_new_client)
|
|||
client().async_set_window_size(m_client_state.page_index, viewport_size());
|
||||
client().async_update_screen_rects(m_client_state.page_index, { screen_rect }, 0);
|
||||
|
||||
set_system_visibility_state(Web::HTML::VisibilityState::Visible);
|
||||
set_system_visibility_state(m_system_visibility_state);
|
||||
|
||||
if (Application::chrome_options().allow_popups == WebView::AllowPopups::Yes)
|
||||
client().async_debug_request(m_client_state.page_index, "block-pop-ups"sv, "off"sv);
|
||||
|
|
|
@ -655,8 +655,10 @@ void WebContentView::initialize_client(WebView::ViewImplementation::CreateNewCli
|
|||
client().async_set_window_handle(m_client_state.page_index, m_client_state.client_handle);
|
||||
|
||||
client().async_set_device_pixels_per_css_pixel(m_client_state.page_index, m_device_pixel_ratio);
|
||||
update_palette();
|
||||
|
||||
set_system_visibility_state(m_system_visibility_state);
|
||||
|
||||
update_palette();
|
||||
update_screen_rects();
|
||||
|
||||
if (auto webdriver_content_ipc_path = WebView::Application::chrome_options().webdriver_content_ipc_path; webdriver_content_ipc_path.has_value())
|
||||
|
|
Loading…
Reference in a new issue