Windows AlertWindow - appearing behind app/plug-in

Hi JUCE devs,

I’ve been pulling my hair out with this one.

Using Windows native AlertWindow implementations for e.g. OK/Cancel message boxes etc - these very often appear behind the application / plug-in window. Subsequently calls can appear in front of the main window (where I want them!) - but there isn’t a clear pattern.

I’ve tried various things, including fiddling with the internal Windows JUCE code, but can’t yet find the reason.

I’d be interested to know if anybody else is seeing this problem?

For now, I’ve had to revert Windows builds to using non-native alerts, which work fine, but don’t look as “platform native” as I’d like (of course!).

NB this happens with both the following forms of code:

  juce::MessageBoxOptions options = juce::MessageBoxOptions()
                                      .withTitle(title)
                                      .withMessage(message)
                                      .withIconType(juce::AlertWindow::InfoIcon)
                                      .withAssociatedComponent(component)
                                      .withButton(okString);
  juce::AlertWindow::showAsync(
    options, juce::ModalCallbackFunction::create([=](int result) {
  }));

and

  juce::AlertWindow::showMessageBoxAsync (
    juce::AlertWindow::InfoIcon,
    title,
    message,
    okString,
    component);

Best wishes to all, Pete

There was a similar issue reported the other day, but I wasn’t able to reproduce it:

Does this sound like the same issue to you? Apparently the alert window wasn’t showing at all for the person in the other thread. For you, is the alert window definitely on-screen, but with the wrong z-ordering?

Hi @reuk,

Thanks for getting back to me.

It is a different issue.

However I did see the issue very similar to that other thread, while I was experimenting with trying to get this all working - so with some configurations, I saw the blue circle, and/or the alert not showing. I hope that helps.

To be clear, I saw the issue with or without:
JUCE_MODAL_LOOPS_PERMITTED=1

I’m now back to not allowing Modal Loops, to be clear (!), but I experimented with a lot of things.

Correct: the Z ordering is wrong - I have to use Alt-Tab to find it. Very confusing :slight_smile: so am currently back to non-native alerts of this form on Windows.

With best wishes,

Best wishes,

Pete

Thanks for reporting the issue. There’s a change out on develop that should fix this problem.

1 Like

Hi @attila that sounds perfect, thank you!

Pete