Windows FileChooser triggers new assert in Component::grabKeyboardFocus()


#1

In commit https://github.com/julianstorer/JUCE/commit/e253b8bea170cd017c277ba244c0b7b217d4d39e an assertion was added to Component::grabKeyboardFocus().

This assertion is triggered by the windows FileChooser when the native dialog with a juce component as the FilePreviewComponent is used. In juce_win32_FileChooser.cpp this code triggers the problem (starting on line 214):

   if (extraInfoComponent != nullptr)
    {
        flags |= OFN_ENABLEHOOK;

        info.customComponent = new CustomComponentHolder (extraInfoComponent);
        info.customComponent->enterModalState();
    }

This probably means the keyboard focus is not working for the previewComponent and the windows implementation most likely needs a fix.


#2

Bump-edi-bump. This is JUCE code breaking a JUCE assert, please fix by improving the code or relaxing the assert.


#3

Ah yes, sorry, meant to sort this out. Will do right away!