Files
wayland_server/examples/simple_compd.rs
T

35 lines
688 B
Rust

// SPDX: GPL-2.0-only
use std::io;
use wayland_server::client::Client;
use wayland_server::display::Display;
use wayland_server::global::{Global, GlobalState};
struct State {
}
impl GlobalState for State {
fn handle_output_bind(&self, client: Client, version: u32, id: u32) {
todo!()
}
}
fn main() -> io::Result<()> {
// Creating a compositor State
let state = State {};
// create a wayland display
let display = Display::new()?;
// get the global registry
let global = Global::new(&display, state)?;
println!("Running wayland_display on {}", display.get_name());
display.run()?;
// clean-up
drop(display);
Ok(())
}