Mac OS: full screen mode issue (SOLVED)

Devs, is it possible for you to look into this, please?

Related to this thread: Bug: DocumentWindow add 22 to height when going fullscreen?

MacOS: when i switch non-resizable document window to full-screen mode (green button), some components change their original vertical position (y is increased).

In my case, i have heavy-weight TopLevelWindow on desktop, which is a child of the the app’s main document window. If i switch to full screen multiple times, its vertical position increases every time.

Looks like normal JUCE components are not affected - they retain their position.

Any hint or help would be greatly appreciated! If needed, i can provide simple app which exposes this issue.

JUCE 4.3.1
JUCE 5.4.3

1 Like

Did some debugging - here are my observations…

For example, content component with size 1000 x 500 gets resized (despite non-resizable document window) to 1000 x 522, after switched to full screen.

Looking at NSViewComponentPeer getBounds() method (called by ComponentPeer::handleMovedOrResized())

Rectangle<int> getBounds (const bool global) const
    auto r = [view frame]; <------ after switch to full screen, frame height has value 522, instead 500 ???

This unexpected size change obviously causes further problems (unexpected reposition of child components etc.).

The only solution (workaround) so far which works is something you’d not usually do.

In main component’s resized() method i am checking, if component has proper size (1000 x 500). If not, which is the case when switching to full screen (height is increased to 522 !?!), i am forcing it to that particular size using setSize() method.

As i said, changing size of the component inside resized() method is not really recommended and not something i would do otherwise, but in this case i can’t find other viable solution. Looks like it works flawlessly.

I’ve added a workaround for this here, please let me know if it fixes the issue for you.

Thx for looking into this !!!

I did a quick test and it is working smooth on Mavericks, so i expect it will work on newer versions of macOS as well. Will check Sierra ASAP.

Unfortunately, things got broken a bit on Mavericks (i know it is old system, but it is still my main development system) and it was working until now. When clicking on the full screen button, screen unexpectedly flashes - this was not the case before - anyway window is displayed properly in full-screen mode (centered).

Now, when i exit full-screen, window’s title bar is missing and child component gets misplaced, so i suspect main component size is somehow changed - will debug ASAP.

Edit: confirmed - height of main component is increased for 22 when back from full-screen - Mavericks ONLY !!!

I guess the solution is to leave old behaviour for Mavericks and older systems.

Are you saying that it worked on 10.9 before my commit? I’ve just tried building a test project against the 10.9 SDK and it’s working as expected when entering and exiting fullscreen - can you post a screenshot of what the window looks like for you?

I’ve recorded 2 screen-videos (MP4, total of cca. 20 MB) - i can send them to you along with detailed description of the issues on Mavericks. Let me know where i can send it.

You can contact me via email address: franci dot zabukovec at acusticaudio dot net


You can post them here, or send me a private message.

I can’t upload files here nor in private message, because they are 18 MB (limit is 4 MB). Is it possible to send them to your email ??

Commits on develop branch from 14th May and 21th May are fixing issue.

Thx Ed !!!