[gimp] Add gimp_image_window_is_iconified() and use it in GimpImageWindow



commit 892f9f8876fbba0d60054212260938dc261b8e77
Author: Michael Natterer <mitch gimp org>
Date:   Fri Sep 25 19:04:10 2009 +0200

    Add gimp_image_window_is_iconified() and use it in GimpImageWindow

 app/display/gimpimagewindow.c |   11 +++++++++--
 app/display/gimpimagewindow.h |    2 ++
 2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index 2e53c7a..4a30135 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -374,8 +374,7 @@ gimp_image_window_window_state_event (GtkWidget           *widget,
 
   if (event->changed_mask & GDK_WINDOW_STATE_ICONIFIED)
     {
-      gboolean iconified = (event->new_window_state &
-                            GDK_WINDOW_STATE_ICONIFIED) != 0;
+      gboolean iconified = gimp_image_window_is_iconified (window);
 
       GIMP_LOG (WM, "Image window '%s' [%p] set %s",
                 gtk_window_get_title (GTK_WINDOW (widget)),
@@ -569,6 +568,14 @@ gimp_image_window_get_fullscreen (GimpImageWindow *window)
   return (window->window_state & GDK_WINDOW_STATE_FULLSCREEN) != 0;
 }
 
+gboolean
+gimp_image_window_is_iconified (GimpImageWindow *window)
+{
+  g_return_val_if_fail (GIMP_IS_IMAGE_WINDOW (window), FALSE);
+
+  return (window->window_state & GDK_WINDOW_STATE_ICONIFIED) != 0;
+}
+
 void
 gimp_image_window_shrink_wrap (GimpImageWindow *window,
                                gboolean         grow_only)
diff --git a/app/display/gimpimagewindow.h b/app/display/gimpimagewindow.h
index 9a0a6ff..8bc7784 100644
--- a/app/display/gimpimagewindow.h
+++ b/app/display/gimpimagewindow.h
@@ -68,6 +68,8 @@ void          gimp_image_window_set_fullscreen     (GimpImageWindow *window,
                                                     gboolean         fullscreen);
 gboolean      gimp_image_window_get_fullscreen     (GimpImageWindow *window);
 
+gboolean      gimp_image_window_is_iconified       (GimpImageWindow *window);
+
 void          gimp_image_window_shrink_wrap        (GimpImageWindow *window,
                                                     gboolean         grow_only);
 



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