FileChooser::browseForMultipleFilesToOpen() FilePreviewComponent can't accept mouse clicks on Windows

FileChooser::browseForMultipleFilesToOpen() FilePreviewComponent can’t accept mouse clicks on Windows.

I stepped into Component::internalMouseDown and it bails out because isCurrentlyBlockedByAnotherModalComponent()

Here is sample code to reproduce: https://github.com/FigBug/juce_bugs/tree/master/FileChooser

Bump

Thanks. Didn’t see that it got fixed.

I saw this fix in the develop commit log and thus checked my code against it on windows. My preview component used to work fine before all the recent fixes (hidpi etc.), but did not scale for hidpi. Now scaling is fixed, but I’m running into event problems. Before the above commit no events came through at all, but now there appears to be a fight between the native file chooser and the preview component.

When the chooser first opens I see the chooser window is on top (dark title). As soon as I click anywhere in my preview component (there’s just buttons and text), things work but afterwards the chooser moves to the back (title becomes grey). From then on I loose every other mouse click and there seems to be a fight for the top window spot.
Anyone else gets this? Ideally the chooser would never cease to be the top window even if interactions happen with the juce component.

The issue can easily be reproduced with the example G-Mon provided. Just add a ToggleButton to the Preview component and it only toggles on every second click and the window title changes to being non-topmost on the clicks.

For easy copy/paste:

class Preview : public FilePreviewComponent
{
public:
    Preview()
    {
        addAndMakeVisible (test);
        test.onClick = [&]
        {
            AlertWindow::showMessageBox (AlertWindow::InfoIcon, "Test", "Hi");
        };
        addAndMakeVisible(toggle);
        setSize (116, 100);
    }

    void selectedFileChanged (const File&) override
    {
    }

    void resized() override
    {
        test.setBounds (8, 8, 100, 20);
	toggle.setBounds(8, 32, 100, 20);
    }

    TextButton test {"Test"};
    ToggleButton toggle {"Toggle"};
};

This should fix it:

1 Like

Thank you for the very quick action and the awesome commit title!