From 793bb17d47d5b1abb1767cfe9697d345f5f51f4f Mon Sep 17 00:00:00 2001 From: Victoria Brekenfeld Date: Thu, 3 Apr 2025 18:08:44 +0200 Subject: [PATCH] state: Use `WeakOutput` for frame trottling --- src/state.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/state.rs b/src/state.rs index 0eaa17ae..133174c6 100644 --- a/src/state.rs +++ b/src/state.rs @@ -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>, + last_sent_at: RefCell>, } 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