diff --git a/crates/client/src/gui/camera_view.rs b/crates/client/src/gui/camera_view.rs index 423a0a1..14ef6a1 100644 --- a/crates/client/src/gui/camera_view.rs +++ b/crates/client/src/gui/camera_view.rs @@ -56,7 +56,11 @@ impl Yumush { .collect() } - pub(super) fn tick_tiles(&mut self, cx: &mut Context) -> bool { + pub(super) fn tick_tiles( + &mut self, + mut window: Option<&mut Window>, + cx: &mut Context, + ) -> bool { let wanted = self.tile_sources(); let viewing = self.viewing(); let quality = tile_quality(self.chat.stage); @@ -105,7 +109,7 @@ impl Yumush { .surface .update(cx, |surface, cx| surface.replace(None, cx)) { - cx.drop_image(frame, None); + cx.drop_image(frame, window.as_deref_mut()); } if viewing != Some(source) { let network = self.network.clone(); @@ -132,7 +136,7 @@ impl Yumush { .surface .update(cx, |surface, cx| surface.replace(next, cx)) { - cx.drop_image(old, None); + cx.drop_image(old, window.as_deref_mut()); } } @@ -312,16 +316,16 @@ impl Yumush { fn pump(&mut self, window: &mut Window, cx: &mut Context) { self.pumping = false; self.pumped = Instant::now(); - self.tick_viewer(cx); - self.tick_tiles(cx); + self.tick_viewer(Some(window), cx); + self.tick_tiles(Some(window), cx); self.tick_player(window, cx); self.schedule_pump(window, cx); } fn idle_tick(&mut self, cx: &mut Context) -> bool { if self.pumped.elapsed() > PUMP_STALL { - self.tick_viewer(cx); - self.tick_tiles(cx); + self.tick_viewer(None, cx); + self.tick_tiles(None, cx); } self.streaming() } diff --git a/crates/client/src/gui/share_view.rs b/crates/client/src/gui/share_view.rs index 93a6039..d480f9d 100644 --- a/crates/client/src/gui/share_view.rs +++ b/crates/client/src/gui/share_view.rs @@ -363,7 +363,7 @@ impl Yumush { cx.notify(); } - pub(super) fn tick_viewer(&mut self, cx: &mut Context) { + pub(super) fn tick_viewer(&mut self, mut window: Option<&mut Window>, cx: &mut Context) { let Some(viewer) = self.chat.viewer.as_mut() else { return; }; @@ -385,11 +385,11 @@ impl Yumush { .as_ref() .is_some_and(|current| Arc::ptr_eq(current, &old)) { - cx.drop_image(old, None); + cx.drop_image(old, window.as_deref_mut()); } } if let Some(old) = previous { - cx.drop_image(old, None); + cx.drop_image(old, window); } if appeared { cx.notify();