rust-windowing / winit

Window handling library in pure Rust
https://docs.rs/winit/
Apache License 2.0
4.88k stars 911 forks source link

macOS: Avoid redundant initial resize event #3913

Open madsmtm opened 2 months ago

madsmtm commented 2 months ago

The NSViewFrameDidChangeNotification that we listen to is emitted when -[NSWindow setContentView] is called, since that sets the frame of the view as well.

So now we register the notification later, so that it's not triggered at window creation.

Together with https://github.com/rust-windowing/winit/pull/3912, this fixes https://github.com/rust-windowing/winit/issues/3235.

Part of https://github.com/rust-windowing/winit/issues/2640.