seat: Add unique id
This commit is contained in:
parent
b884b91068
commit
b64071b068
2 changed files with 28 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
use crate::{input::ActiveOutput, state::Common};
|
||||
use crate::{input::{ActiveOutput, SeatId}, state::Common};
|
||||
use smithay::{
|
||||
utils::{Logical, Rectangle, Transform},
|
||||
wayland::{output::Output, seat::Seat},
|
||||
|
|
@ -28,6 +28,16 @@ impl OutputExt for Output {
|
|||
}
|
||||
}
|
||||
|
||||
pub trait SeatExt {
|
||||
fn id(&self) -> usize;
|
||||
}
|
||||
|
||||
impl SeatExt for Seat<State> {
|
||||
fn id(&self) -> usize {
|
||||
self.user_data().get::<SeatId>().unwrap().0
|
||||
}
|
||||
}
|
||||
|
||||
pub fn active_output(seat: &Seat<State>, state: &Common) -> Output {
|
||||
seat.user_data()
|
||||
.get::<ActiveOutput>()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue