[gimp] app: turn double buffering off/on when filling/emptying the display



commit 30a45c05e48918b1855b83a1dae4140c1fc9f421
Author: Michael Natterer <mitch gimp org>
Date:   Sat Apr 9 23:15:23 2011 +0200

    app: turn double buffering off/on when filling/emptying the display
    
    instead of turning it off unconditionally in gimp_canvas_init(), so we
    have full control over buffering when we are rendering images, but let
    GTK+ handle a flicker-free wilber itself.

 app/display/gimpcanvas.c       |    1 -
 app/display/gimpdisplayshell.c |    6 ++++++
 2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/app/display/gimpcanvas.c b/app/display/gimpcanvas.c
index 7fc30bc..0c89bb8 100644
--- a/app/display/gimpcanvas.c
+++ b/app/display/gimpcanvas.c
@@ -97,7 +97,6 @@ gimp_canvas_init (GimpCanvas *canvas)
 {
   GtkWidget *widget = GTK_WIDGET (canvas);
 
-  gtk_widget_set_double_buffered (widget, FALSE);
   gtk_widget_set_can_focus (widget, TRUE);
   gtk_widget_add_events (widget, GIMP_CANVAS_EVENT_MASK);
   gtk_widget_set_extension_events (widget, GDK_EXTENSION_EVENTS_ALL);
diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c
index c234dfd..86f8f5d 100644
--- a/app/display/gimpdisplayshell.c
+++ b/app/display/gimpdisplayshell.c
@@ -1320,6 +1320,9 @@ gimp_display_shell_empty (GimpDisplayShell *shell)
 
   gimp_statusbar_empty (GIMP_STATUSBAR (shell->statusbar));
 
+  /*  so wilber doesn't flicker  */
+  gtk_widget_set_double_buffered (shell->canvas, TRUE);
+
   gimp_display_shell_expose_full (shell);
 
   user_context = gimp_get_user_context (shell->display->gimp);
@@ -1374,6 +1377,9 @@ gimp_display_shell_fill (GimpDisplayShell *shell,
                                                                 TRUE,
                                                                 TRUE);
 
+  /*  we double buffer image drawing manually  */
+  gtk_widget_set_double_buffered (shell->canvas, FALSE);
+
   shell->fill_idle_id = g_idle_add_full (G_PRIORITY_LOW,
                                          (GSourceFunc) gimp_display_shell_fill_idle,
                                          shell, NULL);



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