mirror of https://github.com/GNOME/gimp.git
app: remove the manual double buffering from the canvas
It is messing with overlay widgets. Is was effectively disabled since cairo tool drawing was introduced, but not completely.
This commit is contained in:
parent
e19c7eb36c
commit
77e70f3550
|
@ -210,25 +210,6 @@ gimp_display_shell_canvas_size_allocate (GtkWidget *widget,
|
|||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_display_shell_is_double_buffered (GimpDisplayShell *shell)
|
||||
{
|
||||
return TRUE; /* FIXME: repair this after cairo tool drawing is done */
|
||||
|
||||
/* always double-buffer if there are overlay children or a
|
||||
* transform preview, or they will flicker badly. Also double
|
||||
* buffer when we are editing paths.
|
||||
*/
|
||||
#if 0
|
||||
if (GIMP_OVERLAY_BOX (shell->canvas)->children ||
|
||||
gimp_display_shell_get_show_transform (shell) ||
|
||||
GIMP_IS_VECTOR_TOOL (tool_manager_get_active (shell->display->gimp)))
|
||||
return TRUE;
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_display_shell_canvas_expose (GtkWidget *widget,
|
||||
GdkEventExpose *eevent,
|
||||
|
@ -243,15 +224,6 @@ gimp_display_shell_canvas_expose (GtkWidget *widget,
|
|||
{
|
||||
cairo_t *cr;
|
||||
|
||||
if (gimp_display_get_image (shell->display))
|
||||
{
|
||||
if (gimp_display_shell_is_double_buffered (shell))
|
||||
gdk_window_begin_paint_region (eevent->window, eevent->region);
|
||||
}
|
||||
|
||||
/* create the cairo_t after enabling double buffering, or we
|
||||
* will get the wrong window destination surface
|
||||
*/
|
||||
cr = gdk_cairo_create (gtk_widget_get_window (shell->canvas));
|
||||
gdk_cairo_region (cr, eevent->region);
|
||||
cairo_clip (cr);
|
||||
|
@ -271,28 +243,6 @@ gimp_display_shell_canvas_expose (GtkWidget *widget,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_display_shell_canvas_expose_after (GtkWidget *widget,
|
||||
GdkEventExpose *eevent,
|
||||
GimpDisplayShell *shell)
|
||||
{
|
||||
/* are we in destruction? */
|
||||
if (! shell->display || ! gimp_display_get_shell (shell->display))
|
||||
return TRUE;
|
||||
|
||||
/* ignore events on overlays */
|
||||
if (eevent->window == gtk_widget_get_window (widget))
|
||||
{
|
||||
if (gimp_display_get_image (shell->display))
|
||||
{
|
||||
if (gimp_display_shell_is_double_buffered (shell))
|
||||
gdk_window_end_paint (eevent->window);
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_display_shell_origin_button_press (GtkWidget *widget,
|
||||
GdkEventButton *event,
|
||||
|
|
|
@ -27,9 +27,6 @@ void gimp_display_shell_canvas_size_allocate (GtkWidget *widget,
|
|||
gboolean gimp_display_shell_canvas_expose (GtkWidget *widget,
|
||||
GdkEventExpose *eevent,
|
||||
GimpDisplayShell *shell);
|
||||
gboolean gimp_display_shell_canvas_expose_after (GtkWidget *widget,
|
||||
GdkEventExpose *eevent,
|
||||
GimpDisplayShell *shell);
|
||||
|
||||
gboolean gimp_display_shell_origin_button_press (GtkWidget *widget,
|
||||
GdkEventButton *bevent,
|
||||
|
|
|
@ -574,9 +574,6 @@ gimp_display_shell_constructed (GObject *object)
|
|||
g_signal_connect (shell->canvas, "expose-event",
|
||||
G_CALLBACK (gimp_display_shell_canvas_expose),
|
||||
shell);
|
||||
g_signal_connect_after (shell->canvas, "expose-event",
|
||||
G_CALLBACK (gimp_display_shell_canvas_expose_after),
|
||||
shell);
|
||||
|
||||
g_signal_connect (shell->canvas, "enter-notify-event",
|
||||
G_CALLBACK (gimp_display_shell_canvas_tool_events),
|
||||
|
@ -1355,9 +1352,6 @@ 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);
|
||||
|
||||
shell->rotate_angle = 0.0;
|
||||
gimp_display_shell_rotate_update_transform (shell);
|
||||
|
||||
|
@ -1416,9 +1410,6 @@ 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 (GIMP_DISPLAY_SHELL_FILL_IDLE_PRIORITY,
|
||||
(GSourceFunc) gimp_display_shell_fill_idle, shell,
|
||||
|
|
Loading…
Reference in New Issue