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:
@ -97,7 +97,6 @@ gimp_canvas_init (GimpCanvas *canvas)
|
|||||||
{
|
{
|
||||||
GtkWidget *widget = GTK_WIDGET (canvas);
|
GtkWidget *widget = GTK_WIDGET (canvas);
|
||||||
|
|
||||||
gtk_widget_set_double_buffered (widget, FALSE);
|
|
||||||
gtk_widget_set_can_focus (widget, TRUE);
|
gtk_widget_set_can_focus (widget, TRUE);
|
||||||
gtk_widget_add_events (widget, GIMP_CANVAS_EVENT_MASK);
|
gtk_widget_add_events (widget, GIMP_CANVAS_EVENT_MASK);
|
||||||
gtk_widget_set_extension_events (widget, GDK_EXTENSION_EVENTS_ALL);
|
gtk_widget_set_extension_events (widget, GDK_EXTENSION_EVENTS_ALL);
|
||||||
|
@ -1320,6 +1320,9 @@ gimp_display_shell_empty (GimpDisplayShell *shell)
|
|||||||
|
|
||||||
gimp_statusbar_empty (GIMP_STATUSBAR (shell->statusbar));
|
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);
|
gimp_display_shell_expose_full (shell);
|
||||||
|
|
||||||
user_context = gimp_get_user_context (shell->display->gimp);
|
user_context = gimp_get_user_context (shell->display->gimp);
|
||||||
@ -1374,6 +1377,9 @@ gimp_display_shell_fill (GimpDisplayShell *shell,
|
|||||||
TRUE,
|
TRUE,
|
||||||
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,
|
shell->fill_idle_id = g_idle_add_full (G_PRIORITY_LOW,
|
||||||
(GSourceFunc) gimp_display_shell_fill_idle,
|
(GSourceFunc) gimp_display_shell_fill_idle,
|
||||||
shell, NULL);
|
shell, NULL);
|
||||||
|
Reference in New Issue
Block a user