Make platform input handler private

Automatically record the context on non-view input handlers
Simplify the async window context update() method
This commit is contained in:
Mikayla 2024-01-20 06:56:04 -08:00
parent 0858db9ebb
commit 33105486aa
No known key found for this signature in database
17 changed files with 229 additions and 148 deletions

View file

@ -213,7 +213,12 @@ impl AsyncWindowContext {
}
/// A convenience method for [WindowContext::update()]
pub fn update<R>(
pub fn update<R>(&mut self, update: impl FnOnce(&mut WindowContext) -> R) -> Result<R> {
self.app.update_window(self.window, |_, cx| update(cx))
}
/// A convenience method for [WindowContext::update()]
pub fn update_root<R>(
&mut self,
update: impl FnOnce(AnyView, &mut WindowContext) -> R,
) -> Result<R> {