[wx-dev] Bug in default window positioning in wxMac 2.8 and later

Vadim Zeitlin vadim at wxwindows.org
Sun Mar 4 13:21:32 PST 2007


On Thu, 15 Feb 2007 08:30:03 -0600 Brett Bode <brett at ameslab.gov> wrote:

BB> It looks to me like the problem occurs in the  
BB> wxTopLevelWindowBase::DoCentre(int dir) function in the src/common/ 
BB> toplvcmn.cpp file. In that function it tests against the display  
BB> boundaries defined as:
BB> 
BB> const wxRect rectDisplay(dpy.GetClientArea());
BB> 
BB> On a single display Mac that will return 0 for the top left corner.  
BB> However the menu bar occupies the top 20 or so pixels so the usable  
BB> area of the display is reduced. I have hacked up a workaround that  
BB> sets the top coordinate to 20 which works around the problem for me  
BB> for the moment, but I am sure that is not a preferred general fix.

 I don't know how to get the size of the menubar under Mac but I can
confirm that wxDisplay::GetClientArea() should definitely account for it
and it doesn't do it now which is certainly a bug. Stefan, if you have time
to look at this, please add GetClientArea() implementation to
wxDisplayImplMacOSX class. Otherwise any pointers to Mac API which allows
to get the size of the client area (i.e. excluding the menubar) would be
welcome.

 Thanks,
VZ





More information about the wx-dev mailing list