wayland: Move initialization to the Rust side

This will help make the init procedure safer, by limiting the number of Rust objects that need to be carried to the C side and may be mangled on the way there.

The second benefit is that it allows outputs to become part of new state management.
This commit is contained in:
Dorota Czaplejewicz
2022-01-23 17:12:33 +00:00
parent 1b72cbdfaa
commit f4f44a49ae
9 changed files with 148 additions and 91 deletions

View File

@ -10,11 +10,18 @@ type KeyCode = u32;
pub mod c {
use std::ffi::CStr;
use std::os::raw::{ c_char, c_void };
use std::ptr;
#[repr(transparent)]
#[derive(Clone, Copy)]
pub struct ZwpVirtualKeyboardV1(*const c_void);
impl ZwpVirtualKeyboardV1 {
pub fn null() -> Self {
Self(ptr::null())
}
}
#[repr(C)]
pub struct KeyMap {
fd: u32,