Desktop: Isolate CEF-rendered UI into separate crate and process (#4321)

* Extract CEF rendered UI into a separate process and crate

* Review

* Review

* Review

* Review

* Remove necessary workarounds

* Block on frame copy ack

* Crop and resample frames correctly

* Skip blank frames

* Fix deps

* Fix fmt

* Fix clippy warning

* Review

* Fix todo
This commit is contained in:
Timon
2026-07-14 14:51:20 -07:00
committed by Keavon Chambers
parent 97a43e66fb
commit ba0a97aefe
82 changed files with 4768 additions and 1291 deletions
+34
View File
@@ -0,0 +1,34 @@
use crate::consts::BROWSER_HOST_CONFIG_FLAG;
pub(crate) mod host;
pub(crate) mod messages;
pub(crate) mod spawn;
#[derive(serde::Serialize, serde::Deserialize)]
pub(crate) struct HostConfig {
pub(crate) server: String,
pub(crate) main_pid: u32,
pub(crate) acceleration: bool,
#[cfg(target_os = "linux")]
pub(crate) frame_socket_fd: Option<std::os::fd::RawFd>,
#[cfg(target_os = "macos")]
pub(crate) frame_service: Option<String>,
}
impl HostConfig {
pub(crate) fn to_arg(&self) -> String {
let json = serde_json::to_string(self).expect("HostConfig always serializes");
format!("{BROWSER_HOST_CONFIG_FLAG}{json}")
}
pub(crate) fn from_args(args: &[String]) -> Option<Self> {
let json = args.iter().find_map(|arg| arg.strip_prefix(BROWSER_HOST_CONFIG_FLAG))?;
match serde_json::from_str(json) {
Ok(config) => Some(config),
Err(e) => {
tracing::error!("Malformed host config on the command line: {e}");
None
}
}
}
}