[gimp/gimp-2-8] Bug 664584: WM DELETE event in single window mode is synonym to file-quit.



commit 714c232eee4d966f782d8e882cb5645a8feed0f4
Author: Jehan <jehan girinstud io>
Date:   Sat May 11 09:04:33 2013 +0900

    Bug 664584: WM DELETE event in single window mode is synonym to file-quit.
    
    In multi-window mode, closing an image window is only meant to close
    the current image (unless this is the last empty window).
    In single window mode though, you are meaning to close the whole program.
    
    Thanks to Niels Martignène for the original patch.
    (cherry picked from commit 6008c2019bd2824a272455da59d6212fd3695533)

 app/display/gimpimagewindow.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index e85239f..18f4fb1 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -527,11 +527,17 @@ static gboolean
 gimp_image_window_delete_event (GtkWidget   *widget,
                                 GdkEventAny *event)
 {
-  GimpImageWindow  *window = GIMP_IMAGE_WINDOW (widget);
-  GimpDisplayShell *shell  = gimp_image_window_get_active_shell (window);
+  GimpImageWindow        *window  = GIMP_IMAGE_WINDOW (widget);
+  GimpDisplayShell       *shell   = gimp_image_window_get_active_shell (window);
+  GimpImageWindowPrivate *private = GIMP_IMAGE_WINDOW_GET_PRIVATE (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_ui_manager_activate_action (gimp_image_window_get_ui_manager (window),
+                                     "file", "file-quit");
+  else if (shell)
     gimp_display_shell_close (shell, FALSE);
 
   return TRUE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]