GNOME Bugzilla – Bug 528811
should not keep file-chooser dialogs around
Last modified: 2008-11-24 05:59:23 UTC
GIMP currently keep file-chooser dialogs around and only hides them when the user closes the dialog. The idea was that the dialog should reappear in the same state it was closed. Another reason was that opening the file-chooser dialog used to be slow. It appears that this behavior of GIMP causes quite some problems. We have had several bug reports where GIMP crashed in file-chooser code while the dialog was hidden. Other users are reporting that the dialog is slow to open on second use (bug #527644). It seems that reuse of the dialog is an uncommon code-path which is likely to have bugs. It would probably be a good idea to change this. I will attach a patch that changes the code to destroy the dialogs when the user closes them. There are probably some more changes needed to get reasonable behavior, such as remembering the folder the dialog was last used in.
Created attachment 109505 [details] [review] destroy file dialogs when they are closed
It would help if we could get a clear definition of how the file dialogs should behave. Perhaps Peter can help with this?
I am asking for advice here because we had tons of bug reports in the past from users demanding changes to the behavior of the file dialogs. See for example bug #481002. Note that this is not the only report. Other users asked for different behavior so this is probably difficult to get right for everyone. But I have the impression that we received less such complaints in the past. So perhaps it would be best to stick with the behavior of GIMP 2.4...
That patch doesn't quite work since we still need to attach the save dialog to the image to make sure we don't open two of them. Most of the code can probably stay as-is.
Created attachment 110576 [details] [review] patch that I ended up committing I have done some changes to this. The save dialog is now kept attached to the image while it is alive. This makes sure that there is only one save dialog opened per image. I also added some infrastructure to keep a persistent state of some aspects of the file-chooser dialog. So far only the selected filter is being stored there, but we could easily add other stuff.
2008-05-08 Sven Neumann <sven@gimp.org> * app/widgets/gimpfiledialog.[ch]: added infrastructure to access and set some state information of the GtkFileChooser. * app/dialogs/file-open-dialog.c * app/dialogs/file-save-dialog.c: don't keep the file-chooser dialogs around. Instead keep the state attached to the Gimp object (one state for load, one for save dialogs). Closes bug #528811.
Is this too much of a change to apply to the 2.4 branch?
The 2.4 branch is unmaintained and no more 2.4 releases will be made, so it doesn't make sense to apply it there. You could however of course look up what revision that above commit corresponds to and maintain a separate patch if you want to have this change in a 2.4 build.