Problem with multiple popup windows flashing if shown together

Something has changed recently when it comes to multiple popup windows. This used to work until I recently did an update to grab the latest version of JUCE. I’m now using v6.0.8-794 on Ubuntu 20.04.

The problem is when calling AlertWindow::showMessageBoxAsync() or AlertWindow::showOkCancelBox(). On startup, our application may create a few windows depending on conditions it finds. If it creates only 1 window, then all is fine. If it creates multiple windows, then there is a “flashing” behaviour that looks like this:

Tried passing in nullptr or the main window as the component. Tried creating the modal callback different ways. Tried different incantations of showOkCancelBox(), and showMessageBoxAsync(). Examples of code I have right now is:

AlertWindow::showMessageBoxAsync(AlertWindow::AlertIconType::InfoIcon,
    "DarkMark", "This project has a regex filter:\n\n" + regex_filter);

(Note how there isn’t an async callback in this case, it is used just to display a message.)

And:

AlertWindow::showOkCancelBox(AlertWindow::AlertIconType::QuestionIcon, "DarkMark", msg, "", "", nullptr,
    ModalCallbackFunction::create(
        [=](int result)
        {
            if (result == 1)
            {
                this->import_text_annotations(images_without_json);
            }
        }));

Anyone know how to fix this problem with multiple modal windows on Linux? It has been a few months, but I don’t see any fixes to this problem. It didn’t used to be an issue until recent changes to JUCE.

Took a chance and tried on the juce7 branch (last commit was by Tom Poole on Tue Apr 26 for a macos fix) but the problem exists on that branch as well.