user858224
user858224

Reputation:

Why does an autolayout based NSWindow redraw incorrectly after zooming?

I have created an application from the standard Cocoa application template in Xcode and set it to use automatic reference counting.

All I've added is a toolbar and a table view to the window in MainMenu.xib. If I run the application at this point the application looks like this:

enter image description here

I then click the green zoom button in the title bar. The window subsequently maximizes and fills the entire desktop. I then click the zoom button again. The window shrinks to the original width but not the original height. It's not as tall as it was when it was maximized, but much taller than the original height:

enter image description here

I then right-click on the toolbar and hides it. The toolbar animates away but is then immediately visible again. However, the buttons can't be clicked and the window can't be moved by dragging it. It's just as if the toolbar actually deactivated. In order to illustrate it this is what it looks like if the window is resized in this state:

enter image description here

Why does this happen and what should I do to prevent it? I'm using OS X 10.8 and Xcode 4.4, not the developer previews.

Update: (April 2013) It looks like this is actually a bug in Cocoa. :-(

Update: (June 2013) As of 10.8.4 I can no longer reproduce this issue. :-)

Upvotes: 2

Views: 622

Answers (1)

ChoboDev
ChoboDev

Reputation: 48

You could try to disable "Use Auto Layout" in your .xib files File Inspector, this is a new function in Xcode 4.4 and might cause your windows behavior.

Upvotes: 0

Related Questions