1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +00:00

Ladybird: Generate window handle during client creation

Generate handle UUID for top-level context that is going to
run in created WebContent process and sent it over IPC.

Co-authored-by: Timothy Flynn <trflynn89@pm.me>
This commit is contained in:
Aliaksandr Kalenik 2023-03-16 18:35:19 +03:00 committed by Tim Flynn
parent 7c90c67a71
commit 4717d645d3

View file

@ -36,6 +36,7 @@
#include <LibGfx/SystemTheme.h>
#include <LibJS/Runtime/ConsoleObject.h>
#include <LibMain/Main.h>
#include <LibWeb/Crypto/Crypto.h>
#include <LibWeb/Loader/ContentFilter.h>
#include <LibWebView/WebContentClient.h>
#include <QApplication>
@ -630,6 +631,9 @@ void WebContentView::create_client()
});
};
m_client_state.client_handle = Web::Crypto::generate_random_uuid().release_value_but_fixme_should_propagate_errors();
client().async_set_window_handle(m_client_state.client_handle);
client().async_set_device_pixels_per_css_pixel(m_device_pixel_ratio);
update_palette();
client().async_update_system_fonts(Gfx::FontDatabase::default_font_query(), Gfx::FontDatabase::fixed_width_font_query(), Gfx::FontDatabase::window_title_font_query());