macOS: Avoid redundant initial resize event (#3913)

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.

This behaviour is well described in the documentation:
https://developer.apple.com/documentation/appkit/nsview/postsframechangednotifications?language=objc
This commit is contained in:
Mads Marquart 2024-12-03 18:35:04 +01:00 committed by GitHub
parent edca3ebc41
commit 3657506f6e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 44 additions and 42 deletions

View file

@ -211,3 +211,4 @@ changelog entry.
- On iOS, fixed `SurfaceResized` and `Window::surface_size` not reporting the size of the actual surface.
- On macOS, fixed the scancode conversion for audio volume keys.
- On macOS, fixed the scancode conversion for `IntlBackslash`.
- On macOS, fixed redundant `SurfaceResized` event at window creation.