Unwrap user data in cursor_image_status
This is added on creation of the seat, and unwrapped, when setting the status, so the `unwrap_or` case here seems unnecessary.
This commit is contained in:
parent
fa4bffdbe6
commit
3197e52afd
1 changed files with 9 additions and 13 deletions
|
|
@ -377,19 +377,15 @@ impl SeatExt for Seat<State> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn cursor_image_status(&self) -> CursorImageStatus {
|
fn cursor_image_status(&self) -> CursorImageStatus {
|
||||||
self.user_data()
|
let lock = self.user_data().get::<Mutex<CursorImageStatus>>().unwrap();
|
||||||
.get::<Mutex<CursorImageStatus>>()
|
// Reset the cursor if the surface is no longer alive
|
||||||
// Reset the cursor if the surface is no longer alive
|
let mut cursor_status = lock.lock().unwrap();
|
||||||
.map(|lock| {
|
if let CursorImageStatus::Surface(ref surface) = *cursor_status {
|
||||||
let mut cursor_status = lock.lock().unwrap();
|
if !surface.alive() {
|
||||||
if let CursorImageStatus::Surface(ref surface) = *cursor_status {
|
*cursor_status = CursorImageStatus::default_named();
|
||||||
if !surface.alive() {
|
}
|
||||||
*cursor_status = CursorImageStatus::default_named();
|
}
|
||||||
}
|
cursor_status.clone()
|
||||||
}
|
|
||||||
cursor_status.clone()
|
|
||||||
})
|
|
||||||
.unwrap_or(CursorImageStatus::default_named())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_cursor_image_status(&self, status: CursorImageStatus) {
|
fn set_cursor_image_status(&self, status: CursorImageStatus) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue