Add cursor_image_status/set_cursor_image_status to SeatExt
The `cursor_image_status()` function saves some duplication in various places. The `set_cursor_image_status()` saves a bit less, but is also handy.
This commit is contained in:
parent
ddc23fcaa5
commit
fa4bffdbe6
8 changed files with 52 additions and 105 deletions
|
|
@ -1427,12 +1427,7 @@ impl Common {
|
|||
}
|
||||
|
||||
let is_cursor_image = shell.seats.iter().any(|seat| {
|
||||
seat.user_data()
|
||||
.get::<Mutex<CursorImageStatus>>()
|
||||
.map(|guard| {
|
||||
matches!(*guard.lock().unwrap(), CursorImageStatus::Surface(ref cursor_surface) if cursor_surface == surface)
|
||||
})
|
||||
.unwrap_or(false)
|
||||
matches!(seat.cursor_image_status(), CursorImageStatus::Surface(ref cursor_surface) if cursor_surface == surface)
|
||||
});
|
||||
|
||||
if is_cursor_image {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue