I spoke too soon - that doesn’t seem to do it. (Mac OS/X, 10.6.8.)
You can see the actual code I’m working on here. Note that I’ve instrumented toFront and even put a sizable delay before calling the actual toFront (and yes, it’s this one that’s being called).
I set a breakpoint at that point and stepped through Component::toFront - even into the Objective-C (which I’m not so familiar with but can piece together). Everything looks fine - no problems - except that the component does not, in fact, move to the top…
I’m now going to try a clean build, and then a clean release build (this was built using debug) but I don’t hold much hope for that strategy.
My best guess is that it has to do with the somewhat unusual flow of control.
This program is a client of a master Python program which talks to it through a socket. When the program starts up, it creates the window but doesn’t make it visible or populate it. “Very soon” (in a few milliseconds) the socket connection is established, and the master then sends the client the configuration information it needs to populate itself.
This all works perfectly well - if I bring the window to the front it’s populated and flashing away happily. It just doesn’t make it to the front.
What I think I’m going to try is to not even create the window in the first place until I get that first configuration message. That’s a tiny bit tricky to implement (for boring reasons due to the code) but shouldn’t be too much work. If that DOES work then I’ll direct you to the commit that shows the differences - if it DOES NOT work I’ll come back here and whine again.
Oh, I can also try this on the Raspberry Pi and see if I get the same results, and in fact I will. The RP takes a looooong while to compile C++, but I need a snack anyway…