more minor changes to accomodate for cst2

This commit is contained in:
Jonas Maier 2024-03-03 23:05:44 +01:00
parent 37cd4c22a9
commit b3fcea126c
4 changed files with 17 additions and 13 deletions

View File

@ -52,7 +52,7 @@ impl Listener {
let count = self.pings.clone();
let fut = tokio::spawn(async move {
while self.inner.accept().await.is_ok() {
log::info!("Connection pinged back.");
log::trace!("Connection pinged back.");
self.pings.increase();
}
});

View File

@ -53,15 +53,22 @@ impl Browser {
let mut cmd = Command::new("xdotool");
cmd.arg("mousemove").arg(x.to_string()).arg(y.to_string());
self.browser_process.modify_env(&mut cmd);
log::info!("Mouse Move: {cmd:?}");
if let Err(e) = cmd.output() {
log::warn!("Failed to move mouse ({e:?})");
} else {
cmd = Command::new("xdotool");
cmd.arg("click").arg("1");
self.browser_process.modify_env(&mut cmd);
if let Err(e) = cmd.output() {
log::warn!("Failed to click mouse ({e:?})");
}
return;
}
cmd = Command::new("xdotool");
cmd.arg("click").arg("1");
self.browser_process.modify_env(&mut cmd);
log::info!("Mouse Click: {cmd:?}");
if let Err(e) = cmd.output() {
log::warn!("Failed to click mouse ({e:?})");
}
}
}

View File

@ -102,6 +102,7 @@ pub fn start_chromium(
.arg("-br")
.arg("-ac")
.arg("-noreset")
.arg("-softCursor")
.arg("-screen")
.arg("1600x1200")
.arg(&xephyr_window)

View File

@ -127,11 +127,7 @@ impl BrowserConnection {
};
let req_payload = serde_json::to_string(&req_payload).into_internal_result()?;
if meta.log_trace {
log::trace!("Send: {req_payload}");
} else {
log::info!("Send: {req_payload}");
}
log::trace!("Send: {req_payload}");
self.socket
.send(Message::Text(req_payload))