I’m using the FileChooser with usenative=true in a browser plugin. Code:
FileChooser dlg("Save As...", File::getSpecialLocation(File::userHomeDirectory), String::empty, true);
In IE this seems to work fine, however in Firefox it sometimes hangs after trying a couple of times, usually within 5 tries. When it does hang, the plugin will crash after a minute or so. The save as dialog does appear btw, i just can’t click anything. When I change the usenative to false, it seems to work fine. But i want the native dialog…
I attached the VS debugger, enabling all exceptions, but nothing was catched.
Anyone with the same problem, or maybe this is a known issue ?
- Just before this piece of code, MessageManager::isThisTheMessageThread() returns true.
Woah… No, sorry, that’s not going to work.
…in fact, you might want to set JUCE_MODAL_LOOPS_PERMITTED to 0, to make sure that you don’t do anything naughty.
I think u misunderstood - I’m not using a messageloop; i just used MessageManager::isThisTheMessageThread() to test (thought it would tell me whether or not i’m on the main thread).
And in my plugin:
const var BrowserObject::Download(const var* params, int numParams)
FileChooser dlg(title, File::getSpecialLocation(File::userHomeDirectory), String::empty, true);
This I can do right?
No! Like I said, you should avoid anything modal, and browseForFileToSave() is obviously going to go off and run a modal loop!
Why not use a juce dialog box that’s embedded inside your plugin’s window, and run it non-modally?
I’ve no idea why it’d crash with a native box, but you’ve got to expect that the browser will interact unpredictably with things like that, and avoid them.