app: Check for dirty images before forcing single-window mode

Check for dirty images before forcing single-window mode since it is
annoying to have the UI split up and _then_ being asked about unsaved
images. The user might even click 'Cancel' in which case the UI will
have been switched to multi-window mode.
This commit is contained in:
Martin Nordholts 2010-01-06 18:19:20 +01:00
parent 5c4154d438
commit 33573b466b
1 changed files with 9 additions and 7 deletions

View File

@ -562,13 +562,6 @@ gui_exit_callback (Gimp *gimp,
if (gimp->be_verbose)
g_print ("EXIT: %s\n", G_STRFUNC);
/* Since single-window mode is not session managed yet, force
* disabling of the mode before exit to prevent loss of dockables
*/
g_object_set (gui_config,
"single-window-mode", FALSE,
NULL);
if (! force && gimp_displays_dirty (gimp))
{
gimp_dialog_factory_dialog_raise (global_dialog_factory,
@ -578,6 +571,15 @@ gui_exit_callback (Gimp *gimp,
return TRUE; /* stop exit for now */
}
/* Since single-window mode is not session managed yet, force
* disabling of the mode before exit to prevent loss of
* dockables. Make sure to do this _after_ we have asked about
* saving unsaved images.
*/
g_object_set (gui_config,
"single-window-mode", FALSE,
NULL);
gimp->message_handler = GIMP_CONSOLE;
gui_unique_exit ();