<p></p>
<p dir="auto">Let me summarise Geany current behaviour without this change.</p>
<pre><code>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)
</code></pre>
<p dir="auto">Currently Geany does not set home, or current working directory, it falls back to the GTK filechooser default behaviour.</p>
<p dir="auto">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.</p>
<p dir="auto">I have no idea what the Windows native dialog does.</p>
<p dir="auto">I am presuming <a class="user-mention" data-hovercard-type="user" data-hovercard-url="/users/xiota/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/xiota">@xiota</a>'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.</p>
<blockquote>
<p dir="auto">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.</p>
</blockquote>
<p dir="auto">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.</p>
<blockquote>
<p dir="auto">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.</p>
</blockquote>
<p dir="auto">Makes sense except fallback to GTK default behaviour not home.</p>
<p dir="auto">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.</p>
<p dir="auto">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.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/pull/3001#issuecomment-970795471">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAIOWJ42AU6Y2KB4I7SQAJTUMLQKVANCNFSM5H77C55A">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<img src="https://github.com/notifications/beacon/AAIOWJ3CAHLKXNH3Y3V6U2LUMLQKVA5CNFSM5H77C55KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHHOSTTY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/pull/3001#issuecomment-970795471",
"url": "https://github.com/geany/geany/pull/3001#issuecomment-970795471",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>