GNOME Bugzilla – Bug 145492
user can quit while saving compressed xcf
Last modified: 2005-10-29 01:43:50 UTC
During the process of saving an uncompressed xcf, the GUI is make inaccessible, so you cannot quit before a file is finished saving. When you save a compressed xcf (xcf.bz2, xcf.gz), the GUI is only inaccessible while saving the temporary uncompressed xcf. Afterwards the save dialog is closed and it looks like a bzip2 process is created to compress the file, during which you can access the GUI again. It is quite likely that one may quit during the compression process, as I did, because it appears that GIMP has completed saving. I was able to rescue the uncompressed xcf from the .gimp/tmp/ directory, but I doubt that most users would realize this. The save dialog should not close and the user should not be given access to the GUI again until the compression process has completed. (For the sake of completeness: I did compile with --enable-mp, but I don't know if that would have any bearing here.)
Correction - the save dialog does not close until the compression process is finished. However, as I said, the main GUI is accessible while compressing.
This is a longstanding and well-known problem and I doubt that there's an easy fix.
How about not marking the image as clean until the save proc has returned? Of course that wouldn't prevent the user from destroying the image, but it would at least give plenty of warning. (I don't know what happened in 2.2, but in 2.3, compressor does not return until the compression proc has finished.)
That might be worth trying.
The situation is a little more subtle than I thought. As far as I can tell, images are *already* never marked clean until saving is completed. So, the only case where it is possible to exit before saving is finished, without getting a dirty-image warning, is when the image being saved is already clean. It's not easy to see how to handle this case without getting into hairy issues.
Fixed in CVS: 2005-10-29 Michael Natterer <mitch@gimp.org> Fix bug #145492: * app/actions/file-commands.c (file_save_cmd_callback) * app/dialogs/file-save-dialog.c (file_save_dialog_save_image): set the "file-quit" action insensitive while the image is being saved to prevent data loss. * app/widgets/gimptoolbox.c (gimp_toolbox_delete_event): activate the "file-quit" action instead of calling gimp_exit() directly so trying to close the toolbox while saving is impossible too.