seat: Make render-related state thread-safe

This commit is contained in:
Victoria Brekenfeld 2024-06-07 19:26:23 +02:00 committed by Victoria Brekenfeld
parent bd58481d19
commit c7d50e7c5b
11 changed files with 137 additions and 112 deletions

View file

@ -172,7 +172,8 @@ impl CompositorHandler for State {
.user_data()
.get::<SeatMoveGrabState>()
.unwrap()
.borrow()
.lock()
.unwrap()
.as_ref()
.and_then(|state| {
state

View file

@ -9,7 +9,7 @@ use smithay::{
delegate_seat,
input::{keyboard::LedState, pointer::CursorImageStatus, SeatHandler, SeatState},
};
use std::cell::RefCell;
use std::sync::Mutex;
impl SeatHandler for State {
type KeyboardFocus = KeyboardFocusTarget;
@ -27,9 +27,10 @@ impl SeatHandler for State {
) {
*seat
.user_data()
.get::<RefCell<CursorImageStatus>>()
.get::<Mutex<CursorImageStatus>>()
.unwrap()
.borrow_mut() = image;
.lock()
.unwrap() = image;
}
fn focus_changed(