Desktop: Use multithreaded CEF event loop on Windows and Linux (#3076)

* Prototype multi threaded event loop

* Fix input event dispatch

* Remove dead code

* Reenable do_message_loop_work for macos targets

* Cleanup

* Review cleanup

* Remove outdated comment

* Attempt to fix texture import errors

---------

Co-authored-by: Timon Schelling <me@timon.zip>
This commit is contained in:
Dennis Kobert
2025-08-21 19:46:13 +00:00
committed by GitHub
co-authored by Timon Schelling
parent 0e467907e2
commit e4dd3ce806
16 changed files with 525 additions and 341 deletions
+1 -18
View File
@@ -1,6 +1,4 @@
use cef::{CefString, Frame, ImplBinaryValue, ImplBrowser, ImplFrame, ImplListValue, ImplProcessMessage, ImplV8Context, ProcessId, V8Context, sys::cef_process_id_t};
use super::{Context, Initialized};
use cef::{CefString, Frame, ImplBinaryValue, ImplFrame, ImplListValue, ImplProcessMessage, ImplV8Context, ProcessId, V8Context, sys::cef_process_id_t};
pub(crate) enum MessageType {
SendToJS,
@@ -39,21 +37,6 @@ pub(crate) struct MessageInfo {
pub(crate) trait SendMessage {
fn send_message(&self, message_type: MessageType, message: &[u8]);
}
impl SendMessage for Context<Initialized> {
fn send_message(&self, message_type: MessageType, message: &[u8]) {
let Some(browser) = &self.browser else {
tracing::error!("Browser is not initialized, cannot send message");
return;
};
let Some(frame) = browser.main_frame() else {
tracing::error!("Main frame is not available, cannot send message");
return;
};
frame.send_message(message_type, message);
}
}
impl SendMessage for Option<V8Context> {
fn send_message(&self, message_type: MessageType, message: &[u8]) {
let Some(context) = self else {