Any way to figure out the titleBarHeight on MacOSX when using native title bars?

The problem is this:

int DocumentWindow::getTitleBarHeight() const
{
    return isUsingNativeTitleBar() ? 0 : jmin (titleBarHeight, getHeight() - 4);
}

It returns 0.

Did you ever find the solution to this?

I believe this can be done by directly accessing the peer of your content component. Untested, but try something like

mainWindow->getContentComponent()->getPeer()->getFrameSize().getTop();

The BorderSize class has a few getter methods to obtain the sizes of various parts of the window’s frame.

Hope that helps!

1 Like

Thanks! That does seem to work… although I forget what I was trying to use this for originally. Will file this useful tidbit away. :wink:

1 Like