Browse Source

Require JUCE_MODAL_LOOPS_PERMITTED for native linux file choosers

Signed-off-by: falkTX <falktx@falktx.com>
develop-distrho
falkTX 2 years ago
parent
commit
e0b3cb91a4
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      modules/juce_gui_basics/native/juce_FileChooser_linux.cpp

+ 9
- 1
modules/juce_gui_basics/native/juce_FileChooser_linux.cpp View File

@@ -26,6 +26,7 @@
namespace juce
{
#if JUCE_MODAL_LOOPS_PERMITTED
static bool exeIsAvailable (String executable)
{
ChildProcess child;
@@ -268,10 +269,11 @@ private:
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Native)
};
#endif
bool FileChooser::isPlatformDialogAvailable()
{
#if JUCE_DISABLE_NATIVE_FILECHOOSERS
#if JUCE_DISABLE_NATIVE_FILECHOOSERS || ! JUCE_MODAL_LOOPS_PERMITTED
return false;
#else
static bool canUseNativeBox = exeIsAvailable ("zenity") || exeIsAvailable ("kdialog");
@@ -281,7 +283,13 @@ bool FileChooser::isPlatformDialogAvailable()
std::shared_ptr<FileChooser::Pimpl> FileChooser::showPlatformDialog (FileChooser& owner, int flags, FilePreviewComponent*)
{
#if JUCE_MODAL_LOOPS_PERMITTED
return std::make_shared<Native> (owner, flags);
#else
ignoreUnused (owner);
ignoreUnused (flags);
return nullptr;
#endif
}
} // namespace juce

Loading…
Cancel
Save