Let me summarise Geany current behaviour without this change.
``` if a project is open and it has a base directory: use that as filechooser directory and also add a shortcut to the chooser else if a "startup path" value is set in prefs: use that as filechooser directory
If the document has a path if the path is an absolute path: Geany uses that path and directory in the file chooser overwriting any directory setting made above else: Geany sets the filename and keeps whatever directory (if any) was set above if no directory has been set the dialog will fallback to GTK default behaviour (whatever that is) ```
Currently Geany does not set home, or current working directory, it falls back to the GTK filechooser default behaviour.
I'm not sure what the GTK default behaviour is supposed to be, it may be distro/desktop dependent, here it often seems to default to the current working directory, not home, but even if its not well defined I expect its best to keep using that so Geany follows the normal filechooser behaviour like other apps, not force to home. Note that home is always a shortcut on the filechooser so its easy to select.
I have no idea what the Windows native dialog does.
I am presuming @xiota's suggestions below only apply if the document has no existing path and that "previous save-as path" is the path the last time the save-as dialog was used, not the path of the last saved file.
If no project is loaded, and the previous save-as path is valid, use it instead of the home folder. Otherwise, use the home folder.
Makes sense except should fallback to the prefs "startup path" if there is no previous save-as path then to GTK default behaviour not home.
If a project is loaded, don't use the previous save-as path unless it is a subdir of the project folder or the project folder is invalid. If the previous save-as path is also invalid, fallback to the home folder.
Makes sense except fallback to GTK default behaviour not home.
Note that if valid the project directory is added as an additional shortcut to the ones that the filechooser shows normally. Perhaps a valid last path should be too.
Of course shortcuts can also be defined by the user using the desktop external to Geany, I have a "data" folder pointing to my mirrored array.