--- gnome-canvas.c.REFERENCE 2008-01-18 21:37:22.000000000 -0500 +++ gnome-canvas.c 2008-01-18 17:24:22.000000000 -0500 @@ -78,6 +78,7 @@ #include #include #include +#include #include #include #include @@ -3031,12 +3032,9 @@ if (!GTK_WIDGET_DRAWABLE (widget) || (event->window != canvas->layout.bin_window)) return FALSE; -#ifdef VERBOSE - g_print ("Expose\n"); -#endif - gdk_region_get_rectangles (event->region, &rects, &n_rects); + for (i = 0; i < n_rects; i++) { ArtIRect rect; @@ -3073,6 +3071,7 @@ GtkWidget *widget; ArtIRect *rects; gint n_rects, i; + gboolean invalidated = FALSE; widget = GTK_WIDGET (canvas); @@ -3093,6 +3092,7 @@ for (i = 0; i < n_rects; i++) { GdkEventExpose ex; gint x0, y0, x1, y1; + x0 = MAX (canvas->layout.hadjustment->value - canvas->zoom_xofs, rects[i].x0); y0 = MAX (canvas->layout.vadjustment->value - canvas->zoom_yofs, rects[i].y0); @@ -3110,11 +3110,16 @@ ex.area.height = y1 - y0; ex.region = gdk_region_rectangle (&ex.area); ex.count = 0; - gtk_widget_send_expose (GTK_WIDGET (canvas), (GdkEvent *) &ex); + gdk_window_invalidate_region (ex.window, ex.region, FALSE); + /* now force the update the happen immediately */ gdk_region_destroy (ex.region); + invalidated = TRUE; } } + if (invalidated) + gdk_window_process_updates (canvas->layout.bin_window, FALSE); + art_free (rects); canvas->redraw_x1 = 0; @@ -3141,7 +3146,7 @@ do_update (GnomeCanvas *canvas) { /* Cause the update if necessary */ - + update_again: if (canvas->need_update) { gdouble w2cpx[6]; @@ -3179,6 +3184,8 @@ if (GTK_WIDGET_DRAWABLE (canvas) && canvas->need_redraw) paint (canvas); + + } /* Idle handler for the canvas. It deals with pending updates and redraws. */ @@ -3206,13 +3213,12 @@ { g_assert (canvas->need_update || canvas->need_redraw); - if (!canvas->idle_id) + if (!canvas->idle_id) { canvas->idle_id = g_idle_add_full (CANVAS_IDLE_PRIORITY, idle_handler, canvas, NULL); - -/* canvas->idle_id = gtk_idle_add (idle_handler, canvas); */ + } } /** @@ -3462,8 +3468,8 @@ return; } - remove_idle (canvas); do_update (canvas); + remove_idle (canvas); } /** @@ -3682,8 +3688,9 @@ art_uta_free (canvas->redraw_area); art_uta_free (uta); canvas->redraw_area = new_uta; - if (canvas->idle_id == 0) + if (canvas->idle_id == 0) { add_idle (canvas); + } } else { ArtUta *new_uta;