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

Window widgets are positioned incorrectly in document-based application when showing sheets #200

Open
wadeco opened this issue Sep 15, 2015 · 2 comments

Comments

@wadeco
Copy link

wadeco commented Sep 15, 2015

When using INAppStoreWindow in a document based application on 10.11 the window theme widgets are positioned incorrectly briefly when showing a sheet. I tracked down the cause of the issue and unfortunately the only place to hook into NSWindow to correct the behavior is in -(void)_updateCollectionBehavior. So the fix I have in place looks like this:

-(void)_updateCollectionBehavior
{
[super _updateCollectionBehavior];
[self _layoutTrafficLightsAndContent];
}

Of course, the problem here is that the method is private and therefore may cause problems with App Store applications.

@wadeco
Copy link
Author

wadeco commented Sep 15, 2015

This issue does bring up a common problem with INAppStoreWindow; that being the wack-a-mole style fixes when Apple decides to add yet another way of adjusting the widget positions. I have thought this could be done cleaner within INAppStoreWindow and an idea I had was to simply observe the frame changes on the close/zoom/minimize buttons using the NSViewFrameDidChangeNotification. From within the notification handler, you'd then unregister / move the buttons / re-register for notifications. This would require a bit of work to refactor the existing implementation, but I feel like it might less error prone as AppKit moves forward.

@indragiek
Copy link
Owner

@wadeco That's a good idea. I'll keep this open to track progress in making that fix. I can look into it when I have some time, or I'm also happy to review a PR that implements it.

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

No branches or pull requests

2 participants