My application has an option that allows the user to choose between the standard "full-size" window title / toolbar and the "compact" title bar / toolbar available in the NSWindow 10.10 API. In particular, I use the -titleVisibility method to set either NSWindowTitleVisible or NSWindowTitleHidden depending on the user's preferences. If the user checks the "Compact Titlebar" flag, NSWindowTitleHidden is applied to the window, otherwise the window uses the default style. When the value of the flag changes, the value is saved in the default settings of the application user, and the window is updated / redrawn.
Everything works fine until the application restarts. Each time the application starts, the window grows by how much space is saved, switching from the default window style ( NSWindowTitleVisible ) to the new style ( NSWindowTitleHidden ). Therefore, restarting the application 5-6 times will make the window flush with the menu bar and dock, depending on how large the window is when the flag was originally set.
In other words, it does not look like the window frame is being updated in NSUserDefaults when the property is set. Is there a workaround for this, or am I just missing something? Any advice would be helpful.
Thanks!
source share