Native FileChooser not used on Linux + XFCE

gui

#1

Some users of my application have reported a problem: the native FileChooser on Linux, using XFCE desktop, never shows. Instead, the JUCE one shows.
I of course make sure that I set the “useOSNativeDialogBox” to true when instantiating the FileChooser.

On any other system I tested (Windows, Mac, Linux (Ubuntu/Mint), this works fine though, so the problem seems to be linked with XFCE.

Is it a bug?
One user said : “I’ve been fiddling with the themes in my XFCE, both with GTK2 and GTK3, with no change”.

Thanks!


#2

Check out the constructor for FileChooser(). if you follow the code, you’ll arrive at this native command for Linux:

bool FileChooser::isPlatformDialogAvailable()
{
   #if JUCE_DISABLE_NATIVE_FILECHOOSERS
    return false;
   #else
    static bool canUseNativeBox = exeIsAvailable ("zenity") || exeIsAvailable ("kdialog");
    return canUseNativeBox;
   #endif
}

#3

Yes, your users need to either have zenity or kdialog installed. Simply add those as a dependency to your app.