diff --git a/src/state.rs b/src/state.rs index e8926015..d09e4fc2 100644 --- a/src/state.rs +++ b/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::>() + .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) {