mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-24 07:38:12 +08:00
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:
co-authored by
Timon Schelling
parent
0e467907e2
commit
e4dd3ce806
+1
-18
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user