NSWindow with hidden title, toolbar and auto-save name keeps growing at each launch

Originator:luc
Number:rdar://18510665 Date Originated:01-Oct-2014
Status:State:OpenProduct Resolved:
Product:OS X Product Version:10.10 GM Candidate 1
Classification:Serious Bug Reproducible:Always
 
Summary:
When launching an app that displays a window that happens to hide the title and has a toolbar and has an autosave name, it will keep growing on the Y axis every time you launch the app.

Steps to Reproduce:
1. Create a new Mac project
2. In AppDelegate.m, set self.window.titleVisibility = NSWindowTitleHidden; in awakeFromNib
3. Open MainMenu.XIB
4. Set an autosave name for the window
5. Drag a toolbar in the window
6. Run the app and close it right away.
7. Re-open the app.

Expected Results:
The window should be the same size as it was when the app was terminated.

Actual Results:
The window has grown in the Y axis the same size as the title bar would be if it was visible.

Version:
OS X 10.10 GM Candidate 1

Notes:

Run GrowingWindow project to see behaviour: https://www.dropbox.com/s/4nfgrvcfiuphamq/GrowingWindow.zip?dl=0


Configuration:
N/A

Comments

Got Solution

I've just encountered this issue too and was looking for solution. The problem is that window size is restored by the system using -[NSWindow setFrameUsingName:] before titleVisibility is set. Solution: 1. Remove "Autosave Name" value in Interface Builder. 2. Set it in code right after setting titleVisibility using -[NSWindow setFrameAutosaveName:].


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!