Working around a macOS oddity

Since someone on here mentioned full-screen in a recent thread, I became minded to maximise my app and see how it looked. Basically OK but, under Catalina at least, no menu bar. This was the first time I’d tried this, so I was curious. But I got a shock on coming out of fullscreen mode: In a DesktopContainer, two DesktopRectangles were not drawn, neither were any of the buttons embedded on the larger one. I attempted without success to make this happen in a small project, so instead I looked to mitigate the issue.

Right off I found that the Maximize and Minimize (sic) events do nothing when a window is maximised and then returned to its previous state. The Resizing event fires, however, first going in and then coming out. That, combined with the state of window.FullScreen, allowed the creation of a codepath when leaving fullscreen.

I also found that if I resized the window or nudged a splitter I have next to the DesktopContainer, the missing controls popped back into view. So in the codepath I nudged the splitter a pixel to the right and then a pixel to the left. This didn’t appear to work, so I guessed that I was doing the nudging too early in the process of leaving fullscreen. Delaying that by 10msec by using CallLater, did the trick.

It was easy.

The macOS is pretty buggy nowadays, however I suspect the problem is a view cache that’s not being updated or your views moving off screen. I would suggest checking the later first. If it’s the former, then it’s a bug in the Xojo framework, which you might be able to overcome with declares.