Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: Avoid redundant initial resize event #3913

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

madsmtm
Copy link
Member

@madsmtm madsmtm commented Sep 11, 2024

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 #3912, this fixes #3235.

Part of #2640.

  • Tested on all platforms changed
  • Added an entry to the changelog module if knowledge of this change could be valuable to users

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.
@madsmtm madsmtm added B - bug Dang, that shouldn't have happened DS - macos labels Sep 11, 2024
Copy link
Member

@kchibisov kchibisov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why we not compare the current size with the new size? Just moving the place where the size observer is being set doesn't sound like the right way to solve this(though it likely does solve this).

Just generally tracking the active size and comparing should generally reduce the amount of resizes we're sending to the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B - bug Dang, that shouldn't have happened DS - macos
Development

Successfully merging this pull request may close these issues.

NewEvents(StartCause::Init) fires after RedrawRequested on MacOS
2 participants