diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index aa5689b..87e9c2d 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -531,10 +531,15 @@ gimp_image_window_delete_event (GtkWidget   *widget,
                                 GdkEventAny *event)
 {
   GimpImageWindow  *window = GIMP_IMAGE_WINDOW (widget);
+  GimpImageWindowPrivate *private = GIMP_IMAGE_WINDOW_GET_PRIVATE (window);
   GimpDisplayShell *shell  = gimp_image_window_get_active_shell (window);
+  GimpGuiConfig *config; 
 
-  /* FIXME multiple shells */
-  if (shell)
+  config = GIMP_GUI_CONFIG (gimp_dialog_factory_get_context (private->dialog_factory)->gimp->config);
+
+  if (config->single_window_mode)
+    gimp_exit(private->gimp, FALSE);
+  else if (shell)
     gimp_display_shell_close (shell, FALSE);
 
   return TRUE;
