FileBrowser not remembering last folder on Linux


#1

Hi,

I’m using the FileBrowser to load/save files, using the native component. On both Windows and Mac, once a file has been loaded/saved, opening the FileBrowser automatically opens the last folder opened, which is very handy. However, on Linux, it is not the case, it remains on the same folder (the current user base folder).

I’m using:

FileChooser fileChooser(translate("Open a song"), File(), extensionsFilter);

Is it a bug? It is handy not to have to save the last location elsewhere…

Thanks.


#2

Hmmm, I’m not sure I would call this a bug. The behaviour on linux is consistent to what would happen if you use a non-native dialog box (i.e. FileChooser fileChooser(translate("Open a song"), File(), extensionsFilter, false)). When using a native dialog box, it’s up to the native OS to choose where to open the file chooser. On linux it happens to always open the current working directory.

You can easily override this by saving the last opened document directory yourself.