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

[osx] Fix window's setVisible(true) #111

Merged
merged 1 commit into from
Nov 19, 2024

Conversation

martincapello
Copy link
Member

@@ -511,6 +511,8 @@ - (void)noResponderFor:(SEL)eventSelector
// returns YES).
if (m_nsWindow.canBecomeMainWindow)
[m_nsWindow makeMainWindow];
else
[m_nsWindow setIsVisible:true];
Copy link
Member Author

@martincapello martincapello Nov 15, 2024

Choose a reason for hiding this comment

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

I'm not actually sure if we should call setIsVisible always...if this were the case, then we can just do:

[m_nsWindow setIsVisible:visible]

At the end of WindowOSX::setVisibleand remove the elses.

Just tried and the following seems to work as well:

void WindowOSX::setVisible(bool visible)
{
  if (visible) {
    // The main window can be changed only when the NSWindow
    // is visible (i.e. when NSWindow::canBecomeMainWindow
    // returns YES).
    if (m_nsWindow.canBecomeMainWindow)
      [m_nsWindow makeMainWindow];
  }
  [m_nsWindow setIsVisible:visible];
}

@dacap
Copy link
Member

dacap commented Nov 19, 2024

It works great! 👍

@dacap dacap merged commit a1c113a into aseprite:main Nov 19, 2024
7 checks passed
@martincapello martincapello deleted the fix-window-setVisible branch November 19, 2024 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Color Picker is not shown when setting its visibility to true in macOS
2 participants