Avoid double borrow in tests by drawing windows explicitly in flush_effects
Co-authored-by: Antonio <antonio@zed.dev>
This commit is contained in:
+14
-1
@@ -596,13 +596,26 @@ impl AppContext {
|
||||
}
|
||||
}
|
||||
|
||||
for (_, window) in &self.windows {
|
||||
for window in self.windows.values() {
|
||||
if let Some(window) = window.as_ref() {
|
||||
if window.dirty {
|
||||
window.platform_window.invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
for window in self
|
||||
.windows
|
||||
.values()
|
||||
.filter_map(|window| {
|
||||
let window = window.as_ref()?;
|
||||
window.dirty.then_some(window.handle)
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
{
|
||||
self.update_window(window, |_, cx| cx.draw()).ok();
|
||||
}
|
||||
}
|
||||
|
||||
/// Repeatedly called during `flush_effects` to release any entities whose
|
||||
|
||||
Reference in New Issue
Block a user