Windows no longer coming to front after change

After the following change, my plugin windows aren’t staying in front of my DAW window: Windows: Ensure that new windows are brought to the front after crea… · juce-framework/JUCE@cdbefa3 · GitHub

What was the reason for the change from SetForegroundWindow to BringWindowToTop? It no longer seems to be keeping my plugin windows in front of my main window.

FR: Please support parent hierarchy between top level windows so that it’s a lot easier to do tool windows without weird always on top hacks. (ie pass parent hwnd to CreateWindow but don’t set WS_CHILD)

Sounds like this may be a regression after all.

While working on this, please take into account that prior to JUCE 6.1.3, there was a subtle bug: when starting an application on Windows that opened a maximized window with native title bar, said window appeared behind other windows rather than in front of them.

I’m not sure this is related to the present topic, but please make sure that any change for this doesn’t cause a regression on that issue (that was resolved in JUCE 6.1.3)

I couldn’t reproduce a similar problem with DAWs I’ve tried so far, and I’m guessing from the wording that it may be a DAW that you are developing.

In that case could you try modifying the following function from juce_win32_Windowing.cpp and check whether it resolves the problem for you?

static void* toFrontCallback1 (void* h)
    BringWindowToTop ((HWND) h);
    SetForegroundWindow ((HWND) h);
    return nullptr;

Admittedly this is a bit of a stab in the dark. It’s not obvious what to do in plugins, since the DAW has a lot of power over the visibility of its plugin windows.