develop ← emezeske:pr/linux-filechooser-initial-directory
opened 07:17PM - 30 Jun 26 UTC
### Summary
On Linux, a `FileChooser` constructed with an initial directory o…pens in `$HOME` instead of that directory when the zenity backend is used (the default on non-KDE sessions). The kdialog backend is unaffected.
### Cause
`addZenityArgs()` changes the working directory to the target folder and then passes only `startingFile.getFileName()`, a bare, relative basename, as `--filename`. zenity/GTK does not resolve a relative `--filename`, so it is ignored and the dialog falls back to `$HOME`. When the starting location is a directory, `getFileName()` returns the directory's own leaf name, which is never what's intended.
### Fix
Pass an absolute path in `--filename`. For a directory, append a trailing separator so zenity opens *inside* the folder rather than pre-selecting it within its parent. This mirrors what the kdialog branch already does (it passes a full path).
```
zenity --file-selection --filename=/home/user/Documents/Presets/
```
### Testing
Verified on Wayland with zenity 4.2.1: open, save, and import dialogs now start in the requested directory (presets, environments, recording-output folders) instead of `$HOME`.