Need way to get window frame from content for fullscreen exit calculations

Originator:lrucker
Number:rdar://12144703 Date Originated:21-Aug-2012
Status:Open Resolved:
Product:Mac OS Product Version:10.7
Classification:UI Reproducible:Always
 
Summary:
In window:startCustomAnimationToExitFullScreenWithDuration:, I know the target contentRect but I can't use -frameRectForContentRect: to find the target frameRect because the window style is still fullscreen, and can't use +frameRectForContentRect:styleMask: because it doesn't know about the toolbar.

Because all the windows using the same toolbar get updated when the toolbar style changes, I can't just save the window and/or toolbar size before going into fullscreen because it may not be valid when I exit. 


So what I need is either a 
-[NSWindow frameRectForContentRect:styleMask:]

to return the rect a window's frame should be if it were using the given style mask, taking toolbar into account, or

-[NSToolbar toolbarHeight]

(the docs for calculating toolbarHeight rely on frameRectForContentRect: so they're useless in the new FS world)

then I could do 

   NSRect windowFrame = [NSWindow frameRectForContentRect:windowContent
                                                styleMask:NSTitledWindowMask];
   if ([[window toolbar] isVisible]) {
      // isVisible returns the correct value even if we're in fullscreen and the FS toolbar is in a different state
      // I am assuming that's not going to change.
      windowFrame.size.height +=[[window toolbar] toolbarHeight] ;
   }

Comments


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!