gimp r25138 - in trunk: . app/display



Author: mitch
Date: Thu Mar 20 10:37:43 2008
New Revision: 25138
URL: http://svn.gnome.org/viewvc/gimp?rev=25138&view=rev

Log:
2008-03-20  Michael Natterer  <mitch gimp org>

	* app/display/gimpdisplayshell.[ch]: shrink-wrap the newly filled
	empty display in an idle function.



Modified:
   trunk/ChangeLog
   trunk/app/display/gimpdisplayshell.c
   trunk/app/display/gimpdisplayshell.h

Modified: trunk/app/display/gimpdisplayshell.c
==============================================================================
--- trunk/app/display/gimpdisplayshell.c	(original)
+++ trunk/app/display/gimpdisplayshell.c	Thu Mar 20 10:37:43 2008
@@ -286,6 +286,8 @@
   shell->icon_size              = 32;
   shell->icon_idle_id           = 0;
 
+  shell->fill_idle_id           = 0;
+
   shell->cursor_format          = GIMP_CURSOR_FORMAT_BITMAP;
   shell->current_cursor         = (GimpCursorType) -1;
   shell->tool_cursor            = GIMP_TOOL_CURSOR_NONE;
@@ -481,6 +483,12 @@
       shell->title_idle_id = 0;
     }
 
+  if (shell->fill_idle_id)
+    {
+      g_source_remove (shell->fill_idle_id);
+      shell->fill_idle_id = 0;
+    }
+
   if (shell->nav_popup)
     {
       gtk_widget_destroy (shell->nav_popup);
@@ -1094,6 +1102,12 @@
   g_return_if_fail (GIMP_IS_DISPLAY (shell->display));
   g_return_if_fail (GIMP_IS_IMAGE (shell->display->image));
 
+  if (shell->fill_idle_id)
+    {
+      g_source_remove (shell->fill_idle_id);
+      shell->fill_idle_id = 0;
+    }
+
   gimp_display_shell_connect (shell);
 
   g_signal_emit (shell, display_shell_signals[RECONNECT], 0);
@@ -1113,6 +1127,12 @@
   g_return_if_fail (GIMP_IS_DISPLAY (shell->display));
   g_return_if_fail (shell->display->image == NULL);
 
+  if (shell->fill_idle_id)
+    {
+      g_source_remove (shell->fill_idle_id);
+      shell->fill_idle_id = 0;
+    }
+
   gimp_display_shell_selection_control (shell, GIMP_SELECTION_OFF);
 
   gimp_display_shell_scale (shell, GIMP_ZOOM_TO, 1.0);
@@ -1129,6 +1149,16 @@
   gimp_display_shell_expose_full (shell);
 }
 
+static gboolean
+gimp_display_shell_fill_idle (GimpDisplayShell *shell)
+{
+  shell->fill_idle_id = 0;
+
+  gimp_display_shell_scale_shrink_wrap (shell);
+
+  return FALSE;
+}
+
 void
 gimp_display_shell_fill (GimpDisplayShell *shell,
                          GimpImage        *image,
@@ -1149,6 +1179,10 @@
   gimp_statusbar_fill (GIMP_STATUSBAR (shell->statusbar));
 
   gimp_display_shell_appearance_update (shell);
+
+  shell->fill_idle_id = g_idle_add_full (G_PRIORITY_LOW,
+                                         (GSourceFunc) gimp_display_shell_fill_idle,
+                                         shell, NULL);
 }
 
 /*

Modified: trunk/app/display/gimpdisplayshell.h
==============================================================================
--- trunk/app/display/gimpdisplayshell.h	(original)
+++ trunk/app/display/gimpdisplayshell.h	Thu Mar 20 10:37:43 2008
@@ -135,6 +135,8 @@
   gint              icon_size;         /*  size of the icon pixmap            */
   guint             icon_idle_id;      /*  ID of the idle-function            */
 
+  guint             fill_idle_id;      /*  display_shell_fill() idle ID       */
+
   GimpCursorFormat    cursor_format;   /*  Currently used cursor format       */
   GimpCursorType      current_cursor;  /*  Currently installed main cursor    */
   GimpToolCursorType  tool_cursor;     /*  Current Tool cursor                */



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