🚧 Proper WAYLAND_SOCKET setup, I think.

This commit is contained in:
Lucy 2022-06-30 10:35:02 -04:00
parent 97fa3df483
commit f39cdb37b5
No known key found for this signature in database
GPG key ID: EBC517FAD666BBF1
2 changed files with 84 additions and 29 deletions

View file

@ -33,23 +33,36 @@ async fn main() -> Result<()> {
let token = CancellationToken::new();
let (env_tx, env_rx) = oneshot::channel();
let (socket_tx, socket_rx) = mpsc::unbounded_channel();
tokio::spawn(comp::run_compositor(token.child_token(), socket_rx, env_tx));
tokio::spawn({
let token = token.child_token();
async move {
if let Err(err) = comp::run_compositor(token, socket_rx, env_tx).await {
error!("compositor errored: {:?}", err);
}
}
});
let env_vars = env_rx
.await
.expect("failed to receive environmental variables");
info!("got environmental variables: {:?}", env_vars);
let mut sockets = Vec::with_capacity(2);
tokio::spawn(panel::run_panel(
token.child_token(),
"testing-panel",
env_vars.clone(),
comp::create_privileged_socket(&mut sockets, &env_vars)
.wrap_err("failed to create panel socket")?,
));
tokio::spawn(panel::run_panel(
token.child_token(),
"testing-dock",
env_vars.clone(),
comp::create_privileged_socket(&mut sockets, &env_vars)
.wrap_err("failed to create dock socket")?,
));
socket_tx.send(sockets).unwrap();
let mut signals = Signals::new(vec![libc::SIGTERM, libc::SIGINT]).unwrap();
while let Some(signal) = signals.next().await {
match signal {