state: Send frame-callbacks to cursor surfaces
This commit is contained in:
parent
691988eed6
commit
3b5bf4a125
1 changed files with 30 additions and 2 deletions
32
src/state.rs
32
src/state.rs
|
|
@ -28,7 +28,7 @@ use smithay::{
|
|||
update_surface_primary_scanout_output, with_surfaces_surface_tree,
|
||||
OutputPresentationFeedback,
|
||||
},
|
||||
input::{Seat, SeatState},
|
||||
input::{pointer::CursorImageStatus, Seat, SeatState},
|
||||
output::{Mode as OutputMode, Output, Scale},
|
||||
reexports::{
|
||||
calloop::{LoopHandle, LoopSignal},
|
||||
|
|
@ -39,7 +39,7 @@ use smithay::{
|
|||
Display, DisplayHandle,
|
||||
},
|
||||
},
|
||||
utils::{Clock, Monotonic},
|
||||
utils::{Clock, IsAlive, Monotonic},
|
||||
wayland::{
|
||||
compositor::CompositorState,
|
||||
data_device::DataDeviceState,
|
||||
|
|
@ -361,6 +361,34 @@ impl Common {
|
|||
let time = self.clock.now();
|
||||
let throttle = Some(Duration::from_secs(1));
|
||||
|
||||
for seat in self.seats.iter() {
|
||||
if &seat.active_output() == output {
|
||||
let cursor_status = seat
|
||||
.user_data()
|
||||
.get::<RefCell<CursorImageStatus>>()
|
||||
.map(|cell| {
|
||||
let mut cursor_status = cell.borrow_mut();
|
||||
if let CursorImageStatus::Surface(ref surface) = *cursor_status {
|
||||
if !surface.alive() {
|
||||
*cursor_status = CursorImageStatus::Default;
|
||||
}
|
||||
}
|
||||
cursor_status.clone()
|
||||
})
|
||||
.unwrap_or(CursorImageStatus::Default);
|
||||
|
||||
if let CursorImageStatus::Surface(wl_surface) = cursor_status {
|
||||
send_frames_surface_tree(
|
||||
&wl_surface,
|
||||
output,
|
||||
time,
|
||||
Some(Duration::ZERO),
|
||||
|_, _| None,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let active = self.shell.active_space(output);
|
||||
active.mapped().for_each(|mapped| {
|
||||
if active.outputs_for_element(mapped).any(|o| &o == output) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue