mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-26 03:48:11 +08:00
Desktop: Buffer web messages until connection is initialized (#3082)
Buffer web messages until connection is initialized
This commit is contained in:
@@ -46,6 +46,7 @@ pub(crate) trait CefEventHandler: Clone {
|
||||
/// Scheudule the main event loop to run the cef event loop after the timeout
|
||||
/// [`_cef_browser_process_handler_t::on_schedule_message_pump_work`] for more documentation.
|
||||
fn schedule_cef_message_loop_work(&self, scheduled_time: Instant);
|
||||
fn initialized_web_communication(&self);
|
||||
fn receive_web_message(&self, message: &[u8]);
|
||||
}
|
||||
|
||||
@@ -145,6 +146,10 @@ impl CefEventHandler for CefHandler {
|
||||
let _ = self.event_loop_proxy.send_event(CustomEvent::ScheduleBrowserWork(scheduled_time));
|
||||
}
|
||||
|
||||
fn initialized_web_communication(&self) {
|
||||
let _ = self.event_loop_proxy.send_event(CustomEvent::WebCommunicationInitialized);
|
||||
}
|
||||
|
||||
fn receive_web_message(&self, message: &[u8]) {
|
||||
let Some(desktop_wrapper_message) = deserialize_editor_message(message) else {
|
||||
tracing::error!("Failed to deserialize web message");
|
||||
|
||||
Reference in New Issue
Block a user