<p>After having a closer look at the code, it turned out it is not so easy to fix.<br>
Either:</p>
<ol>
<li>remember the error in the plugin and disable auto save for this document (i.e. keep a map of all documents and their auto save status)</li>
<li>change <code>document_save_file()</code> in Geany itself to use info bars instead of dialogs to circumvent the dialog-document-focus-steal circle</li>
<li>introduce a variant of the <code>document_save_file()</code> function to return <code>FALSE</code> as now but additionally a <code>GError</code> object to tell the caller about the error but do not any GUI interaction, so the caller can handle error all on its own</li>
</ol>
<p>I consider only 3. as a serious solution when comparing cost and benefits.<br>
Though I personally probably won't work on this.</p>
<p>As a quick'n'dirty workaround we could add some delay in the plugin when the focus-out auto save resulted in an error. This would not solve the problem at all but enables the user to close the file manually or just fix the underlying file save error.</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/issues/2104#issuecomment-476874663">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ7lxk2r8IAyy2b3_Rh4h4ljmZ-Acks5vapxYgaJpZM4b0Vfw">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABDrJxclbKtYnTJ-jq4FXJxaXMeM9StIks5vapxYgaJpZM4b0Vfw.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@eht16 in #2104: After having a closer look at the code, it turned out it is not so easy to fix.\r\nEither:\r\n\r\n1. remember the error in the plugin and disable auto save for this document (i.e. keep a map of all documents and their auto save status)\r\n2. change `document_save_file()` in Geany itself to use info bars instead of dialogs to circumvent the dialog-document-focus-steal circle\r\n3. introduce a variant of the `document_save_file()` function to return `FALSE` as now but additionally a `GError` object to tell the caller about the error but do not any GUI interaction, so the caller can handle error all on its own\r\n\r\nI consider only 3. as a serious solution when comparing cost and benefits.\r\nThough I personally probably won't work on this.\r\n\r\nAs a quick'n'dirty workaround we could add some delay in the plugin when the focus-out auto save resulted in an error. This would not solve the problem at all but enables the user to close the file manually or just fix the underlying file save error."}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/2104#issuecomment-476874663"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/geany/geany/issues/2104#issuecomment-476874663",
"url": "https://github.com/geany/geany/issues/2104#issuecomment-476874663",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>