Improve Windows "headless" operation
I just happened upon a StackOverflow thread I don't think I'd read before about handling the command line on Windows with Qt.
The basic problem we have now is that if you just go ahead and use the default approach, your app goes into the background and the console issues the next command prompt. Which is a bit odd and probably not wanted. Why it's like that is because most Qt apps aren't headless, of course...
What's suggested here is, on Windows, add CONFIG += console and then create your QtCoreApplication. And it'll stay attached. We currently have something like
#ifdef _WIN32
if (AttachConsole(ATTACH_PARENT_PROCESS) || AllocConsole()){
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
freopen("CONIN$", "r", stdin);
}
#endif
to reattach - but, too late! We're in the background. Instead, we'd want
#ifdef _WIN32
::ShowWindow( ::GetConsoleWindow(), SW_HIDE );
#endif
when running with the GUI to close any launch console. (Might need tuning - maybe check ::GetConsoleWindow() is valid, etc.)
https://stackoverflow.com/questions/45500880/qt-console-application-with-optional-gui
I've not yet tried this out but it could make Jamulus on Windows that bit slicker.
As this is tiny - and done - I've added it to 3.9.0.
Closing. We've decided not to spend further effort on this annoying Windows-specific behaviour.