[gimp] app: raise idle priority for initially scaling and positioning the image



commit 1934b65fcb1d490a39654f502ae157e304fd3627
Author: Michael Natterer <mitch gimp org>
Date:   Sat Dec 15 19:27:16 2012 +0100

    app: raise idle priority for initially scaling and positioning the image
    
    so it is just a bit more important than projection construction. Makes
    initial image display show up in the right place much quicker, but
    still after layouting the shell's widgets.

 app/display/gimpdisplayshell.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c
index a853450..6410d48 100644
--- a/app/display/gimpdisplayshell.c
+++ b/app/display/gimpdisplayshell.c
@@ -82,6 +82,14 @@
 
 #include "gimp-intl.h"
 
+
+/*  halfway between G_PRIORITY_HIGH_IDLE and G_PRIORITY_DEFAULT_IDLE - 1,
+ *  so a bit higher than projection construction
+ */
+#define GIMP_DISPLAY_SHELL_FILL_IDLE_PRIORITY \
+        ((G_PRIORITY_HIGH_IDLE + G_PRIORITY_DEFAULT_IDLE) / 2 - 1)
+
+
 enum
 {
   PROP_0,
@@ -1388,8 +1396,10 @@ gimp_display_shell_fill (GimpDisplayShell *shell,
   /*  we double buffer image drawing manually  */
   gtk_widget_set_double_buffered (shell->canvas, FALSE);
 
-  shell->fill_idle_id = g_idle_add ((GSourceFunc) gimp_display_shell_fill_idle,
-                                    shell);
+  shell->fill_idle_id =
+    g_idle_add_full (GIMP_DISPLAY_SHELL_FILL_IDLE_PRIORITY,
+                     (GSourceFunc) gimp_display_shell_fill_idle, shell,
+                     NULL);
 }
 
 /* We used to calculate the scale factor in the SCALEFACTOR_X() and



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