state: Use WeakOutput for frame trottling

This commit is contained in:
Victoria Brekenfeld 2025-04-03 18:08:44 +02:00
parent cbc4ad6fc2
commit 793bb17d47

View file

@ -59,7 +59,7 @@ use smithay::{
PopupManager,
},
input::{pointer::CursorImageStatus, SeatState},
output::{Output, Scale},
output::{Output, Scale, WeakOutput},
reexports::{
calloop::{LoopHandle, LoopSignal},
wayland_protocols::xdg::shell::server::xdg_toplevel::WmCapabilities,
@ -271,7 +271,7 @@ pub struct SurfaceDmabufFeedback {
#[derive(Debug)]
struct SurfaceFrameThrottlingState {
last_sent_at: RefCell<Option<(Output, usize)>>,
last_sent_at: RefCell<Option<(WeakOutput, usize)>>,
}
impl Default for SurfaceFrameThrottlingState {
fn default() -> Self {
@ -985,7 +985,7 @@ impl Common {
}
if send {
*last_sent_at = Some((output.clone(), sequence));
*last_sent_at = Some((output.downgrade(), sequence));
Some(output.clone())
} else {
None