T46: Ely peeks over the main window's top edge from behind it, as the owner asked after the 0.1.3 film: her head and fingers from the icon's paths in a transparent window of her own, kept on the edge as each platform allows, macOS's child window, Windows' owned popup, X11's popup moved and stacked above the frame, Wayland's anchored popup; ten faces follow the most pressing of the sessions' marks, with hops, a shake and a rise; a press winks; Settings, Terminal, Ely turns her off
This commit is contained in:
22 files changed
+1090
-45
No files matched your search
@@ -0,0 +1,37 @@
|
||||
//! Xvfb for the X11 tests.
|
||||
|
||||
use std::{
|
||||
io::{BufRead, BufReader},
|
||||
process::{Child, Command, Stdio},
|
||||
};
|
||||
|
||||
/// An X server of the test's own, gone with it.
|
||||
pub struct Xvfb {
|
||||
child: Child,
|
||||
pub display: String,
|
||||
}
|
||||
|
||||
impl Xvfb {
|
||||
pub fn start() -> Self {
|
||||
let mut child = Command::new("Xvfb")
|
||||
.args(["-displayfd", "1", "-nolisten", "tcp"])
|
||||
.stdout(Stdio::piped())
|
||||
.spawn()
|
||||
.expect("Xvfb starts: the X11 tests need it");
|
||||
let mut number = String::new();
|
||||
let stdout = child.stdout.take().expect("Xvfb's stdout");
|
||||
BufReader::new(stdout)
|
||||
.read_line(&mut number)
|
||||
.expect("Xvfb names its display");
|
||||
let display = format!(":{}", number.trim());
|
||||
Self { child, display }
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Xvfb {
|
||||
fn drop(&mut self) {
|
||||
if let Err(error) = self.child.kill().and_then(|()| self.child.wait().map(drop)) {
|
||||
eprintln!("Xvfb {} did not stop: {error}", self.display);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user