[gimp] app: Pause tool drawing while hiding docks in single-window mode



commit ed5830fb7b7657232315f7c54385cc3aee32d911
Author: Martin Nordholts <martinn src gnome org>
Date:   Thu Feb 25 21:37:02 2010 +0100

    app: Pause tool drawing while hiding docks in single-window mode
    
    Freeze the active tool until the UI has stabilized. If it draws while
    we hide widgets there will be flicker. See bug 602223.

 app/display/gimpimagewindow.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/app/display/gimpimagewindow.c b/app/display/gimpimagewindow.c
index e242d68..2d58e33 100644
--- a/app/display/gimpimagewindow.c
+++ b/app/display/gimpimagewindow.c
@@ -141,6 +141,7 @@ static void      gimp_image_window_hide_tooltip        (GimpUIManager       *man
                                                         GimpImageWindow     *window);
 
 static void      gimp_image_window_keep_canvas_pos     (GimpImageWindow     *window);
+static gboolean  gimp_image_window_resume_shell        (GimpDisplayShell    *shell);
 static void      gimp_image_window_shell_size_allocate (GimpDisplayShell    *shell,
                                                         GtkAllocation       *allocation,
                                                         PosCorrectionData   *data);
@@ -1112,6 +1113,12 @@ gimp_image_window_keep_canvas_pos (GimpImageWindow *window)
   gint               image_origin_window_y = -1;
   PosCorrectionData *data                  = NULL;
 
+  /* Freeze the active tool until the UI has stabilized. If it draws
+   * while we hide widgets there will be flicker
+   */
+  gimp_display_shell_pause (shell);
+  g_idle_add ((GSourceFunc) gimp_image_window_resume_shell, shell);
+
   gimp_display_shell_transform_xy (shell,
                                    0.0, 0.0,
                                    &image_origin_shell_x, &image_origin_shell_y,
@@ -1131,6 +1138,14 @@ gimp_image_window_keep_canvas_pos (GimpImageWindow *window)
                          G_CONNECT_AFTER);
 }
 
+static gboolean
+gimp_image_window_resume_shell (GimpDisplayShell *shell)
+{
+  gimp_display_shell_resume (shell);
+
+  return FALSE;
+}
+
 static void
 gimp_image_window_shell_size_allocate (GimpDisplayShell  *shell,
                                          GtkAllocation     *allocation,



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