This commit is contained in:
Kay Simmons 2023-01-22 20:33:21 -08:00
parent 15799f7af6
commit a581d0c5b8
8 changed files with 301 additions and 311 deletions

View file

@ -2377,11 +2377,20 @@ impl MutableAppContext {
let window = this.cx.windows.get_mut(&window_id)?;
window.is_fullscreen = is_fullscreen;
let mut observations = this.window_fullscreen_observations.clone();
observations.emit(window_id, this, |callback, this| {
let mut fullscreen_observations = this.window_fullscreen_observations.clone();
fullscreen_observations.emit(window_id, this, |callback, this| {
callback(is_fullscreen, this)
});
let bounds = if this.window_is_fullscreen(window_id) {
WindowBounds::Fullscreen
} else {
WindowBounds::Fixed(this.window_bounds(window_id))
};
let mut bounds_observations = this.window_bounds_observations.clone();
bounds_observations.emit(window_id, this, |callback, this| callback(bounds, this));
Some(())
});
}