1
0
Fork 0
forked from wry/wry

wl_usr: add additional interfaces

This commit is contained in:
Julian Orth 2026-02-22 00:11:31 +01:00
parent 56290d5547
commit ce30901093
16 changed files with 1062 additions and 23 deletions

View file

@ -3,7 +3,11 @@ use {
object::Version,
utils::clonecell::CloneCell,
wire::{WlSeatId, wl_seat::*},
wl_usr::{UsrCon, usr_ifs::usr_wl_pointer::UsrWlPointer, usr_object::UsrObject},
wl_usr::{
UsrCon,
usr_ifs::{usr_wl_keyboard::UsrWlKeyboard, usr_wl_pointer::UsrWlPointer},
usr_object::UsrObject,
},
},
std::{cell::Cell, convert::Infallible, rc::Rc},
};
@ -42,6 +46,23 @@ impl UsrWlSeat {
});
ptr
}
#[expect(dead_code)]
pub fn get_keyboard(&self) -> Rc<UsrWlKeyboard> {
let kb = Rc::new(UsrWlKeyboard {
id: self.con.id(),
con: self.con.clone(),
keyboard: Default::default(),
owner: Default::default(),
version: self.version,
});
self.con.add_object(kb.clone());
self.con.request(GetKeyboard {
self_id: self.id,
id: kb.id,
});
kb
}
}
impl WlSeatEventHandler for UsrWlSeat {