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.
This commit is contained in:
Michael Natterer 2011-04-09 23:15:23 +02:00
parent 22bcec1818
commit 30a45c05e4
2 changed files with 6 additions and 1 deletions

View File

@ -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);

View File

@ -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);