[gimp] Move more window managing code to GimpImageWindow



commit 90ef404d988f841190067d3ceb5eed868f7d43d0
Author: Michael Natterer <mitch gimp org>
Date:   Wed Sep 23 15:05:00 2009 +0200

    Move more window managing code to GimpImageWindow
    
    Move the code that (de)iconifies the docks together with an empty
    image window from GimpDisplayShell to GimpImageWindow.

 app/display/gimpdisplayshell.c |   18 ------------------
 app/display/gimpimagewindow.c  |   21 ++++++++++++++++++++-
 2 files changed, 20 insertions(+), 19 deletions(-)
---
diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c
index 28fdd07..99b2f0e 100644
--- a/app/display/gimpdisplayshell.c
+++ b/app/display/gimpdisplayshell.c
@@ -59,7 +59,6 @@
 
 #include "gimpcanvas.h"
 #include "gimpdisplay.h"
-#include "gimpdisplay-foreach.h"
 #include "gimpdisplayoptions.h"
 #include "gimpdisplayshell.h"
 #include "gimpdisplayshell-appearance.h"
@@ -672,23 +671,6 @@ gimp_display_shell_window_state_event (GtkWidget           *widget,
 
   if (event->changed_mask & GDK_WINDOW_STATE_ICONIFIED)
     {
-      gboolean iconified = (event->new_window_state &
-                            GDK_WINDOW_STATE_ICONIFIED) != 0;
-
-      if (iconified)
-        {
-          if (gimp_displays_get_num_visible (gimp) == 0)
-            {
-              GIMP_LOG (WM, "No displays visible any longer");
-
-              gimp_dialog_factories_hide_with_display ();
-            }
-        }
-      else
-        {
-          gimp_dialog_factories_show_with_display ();
-        }
-
       gimp_display_shell_progress_window_state_changed (shell);
     }
 
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index 1b40dfe..a854f06 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -25,9 +25,12 @@
 #include "display-types.h"
 
 #include "widgets/gimpactiongroup.h"
+#include "widgets/gimpdialogfactory.h"
 #include "widgets/gimpmenufactory.h"
 #include "widgets/gimpuimanager.h"
 
+#include "gimpdisplay.h"
+#include "gimpdisplay-foreach.h"
 #include "gimpdisplayshell.h"
 #include "gimpimagewindow.h"
 
@@ -183,7 +186,8 @@ static gboolean
 gimp_image_window_window_state (GtkWidget           *widget,
                                 GdkEventWindowState *event)
 {
-  GimpImageWindow *window = GIMP_IMAGE_WINDOW (widget);
+  GimpImageWindow *window  = GIMP_IMAGE_WINDOW (widget);
+  GimpDisplay     *display = gimp_image_window_get_active_display (window);
 
   window->window_state = event->new_window_state;
 
@@ -213,6 +217,21 @@ gimp_image_window_window_state (GtkWidget           *widget,
                 gtk_window_get_title (GTK_WINDOW (widget)),
                 widget,
                 iconified ? "iconified" : "uniconified");
+
+      if (iconified)
+        {
+          if (gimp_displays_get_num_visible (display->gimp) == 0)
+            {
+              GIMP_LOG (WM, "No displays visible any longer");
+
+              gimp_dialog_factories_hide_with_display ();
+            }
+        }
+      else
+        {
+          gimp_dialog_factories_show_with_display ();
+        }
+
     }
 
   return FALSE;



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