Subject: bug#2546: NS: toolbar height miscalculated

From: David Reitter <[email-masked]>
Date: Mon, 2 Mar 2009 18:24:55 -0500

With a CVS version (--with-ns):

Emacs -Q
click on button in top right corner to show toolbar
C-x 5 2

--> I get what's shown in the screenshot - the window content is shown  
too low.

I experimented a bit with setting the toolbar height correctly in  
update_frame_toolbar() like this:

   EmacsView *view = FRAME_NS_VIEW (f);
   NSWindow *window = [view window];
   FRAME_NS_TOOLBAR_HEIGHT (f) =
     NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0,  
0)])
     - FRAME_NS_TITLEBAR_HEIGHT (f);

  and then updating the toolbar from x_set_window_size(), but that  
didn't do the trick.  Given that the toolbar is assumed to be much too  
large, maybe the problem isn't even in x_set_window_size.

I suspect it is the same "general bug" that causes further issues when  
the toolbar height is assumed to be too short (from reading the  
source, probably 32 pixels) and when the toolbar is actually higher  
(due to other configuration in a more complex scenario).