To demonstrate: 1. "save" a new file (e.g. /tmp/test) 2. "save as" a different, new file (e.g. /tmp/test1) 3. "save as" the first file (/tmp/test). You will get a dialog warning you that the file has been externally modified. You shouldn't get this dialog - it doesn't make sense in this case. 4. overwrite the current file (/tmp/test if you confirmed the last save) from another program (e.g. `echo "hello">/tmp/test`) 5. "save as" the current file, which has been overwritten. You don't get the "externally modified" dialogue. But in this case it does make sense.
I can't reproduce the step 5. Now it seems to be validating if the file was modified externally on "save" and "save as". Can you confirm this? If so, half of the problem is fixed. Mousepad from git(717faec) w/ GTK3 Support.
> I can't reproduce the step 5. Now it seems to be validating if the file was modified externally on "save" and "save as". Can you confirm this? Yes.
Created attachment 8583 proposed patch
Theo Linkspfeifer referenced this bugreport in commit e0e86e870e4fc17b73bed48cb1ec984fecb1c179 Reset modification time when new filename is set (Bug #10498) https://git.xfce.org/apps/mousepad/commit?id=e0e86e870e4fc17b73bed48cb1ec984fecb1c179
Works for me, thanks!
If anyone feels motivated (it's not important probably), but an `else` branch on the new `if` conditional could be added which just returns straight away, since it's now checking whether the filename changed, it makes no sense to free the old one and reallocate a new one when it's already known to be the same.