-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Project files are accessed each time Godot gains focus #32086
Comments
I think this is expected, Godot checks for changes in files to update the view is the files were modified with an external editor. |
@groud I did some more digging and it looks like project.godot is read when the project is opened to populate the Project List in the Project Manager. If you edit project.godot in an external editor then open Godot those changes will be reflected in the Project Manager. Once the project is open in Godot the files don't appear to be read. If you edit project.godot the changes aren't reflected in Godot. Actually now that I've played with it it looks like both project.godot and icon.png.import are overwritten each time Godot gains focus. Why would that happen on focus? |
Do you mean Godot actually opens the file for writing? That would be strange to do that on focus compared to a read. |
Actually, the files shouldn't be opened at all if their modified date didn't change since last check. That would make sense at least. |
But as I understood, opening the file (for read I asume) IS the way Godot tests for that, isn't it? Otherwise it needs OS-specific code (or use |
No, there's a |
Well, it looks like icon.png.import is opened and read on focus regardless of whether or not it was modified. Also, I can't figure out why but when I modify it externally then give Godot focus it will either read the file or the file will be overwritten with whatever the Godot has loaded and any changes are lost. I don't know how to make this happen (or make it stop when it starts) but it will seemingly discard/overwrite my changes to icon.png.import while also happily accepting changes made in default_env.tres and to icon.png. |
How would that help though unless godot is storing mod dates for every file? Are we sure its not using a hash comparison, in which case it would have to read the file? |
Modified time is part of file's metadata, like the name. It's handled by OS. |
To add on to this: I didn't notice there was a hidden .import folder that contains icon.png[...].md5 and icon.png[...].stex. These are also open and read on focus
|
I've been looking into this issue. This bug was fixed by #95678 and should be part of Godot 4.4 when it comes out. I didn't check 3.x. Unless 3.x is EOL or this issue won't be fixed for 3.x; I suggest to close this ticket. |
Godot version:
Godot_v3.1.1-stable_x11.64
OS/device including version:
5.2.11-arch1-1-ARCH
Issue description:
Several project files are accessed or modified each time Godot gains focus. Here is a logfile from inotifywait that was set to monitor the project directory
https://streamable.com/h4jkk
This happens every time Godot loses and regains focus. The file "project.godot" has its "last modified" attribute updated each time this happened which was triggering a backup on my system.
Steps to reproduce:
Open any project in Godot
Switch focus away from Godot then back to it.
The text was updated successfully, but these errors were encountered: