back-port carl's workaround for a gnomecanvas bug that causes a crash during certain resize operations and others

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@7051 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2010-05-04 15:27:23 +00:00
parent 1f3024c324
commit 9a61a9b0bf
3 changed files with 20 additions and 9 deletions

View file

@ -873,7 +873,7 @@ Editor::scroll_canvas_vertically ()
}
last_trackview_group_vertical_offset = get_trackview_group_vertical_offset ();
/* required to keep the controls_layout in lock step with the canvas group */
track_canvas->update_now ();
flush_canvas ();
}
void
@ -948,8 +948,20 @@ void
Editor::flush_canvas ()
{
if (is_mapped()) {
track_canvas->update_now ();
// gdk_window_process_updates (GTK_LAYOUT(track_canvas->gobj())->bin_window, true);
/* GnomeCanvas has a bug whereby if its idle handler is not scheduled between
two calls to update_now, an assert will trip. This wrapper works around
that problem by only calling update_now if the assert will not trip.
I think the GC bug is due to the fact that its code will reset need_update
and need_redraw to FALSE without checking to see if an idle handler is scheduled.
If one is scheduled, GC should probably remove it.
*/
GnomeCanvas* c = track_canvas->gobj ();
if (c->need_update || c->need_redraw) {
track_canvas->update_now ();
}
}
}

View file

@ -2320,7 +2320,7 @@ Editor::cursor_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
show_verbose_time_cursor (cursor->current_frame, 10);
#ifdef GTKOSX
track_canvas->update_now ();
flush_canvas ();
#endif
UpdateAllTransportClocks (cursor->current_frame);
@ -2634,7 +2634,7 @@ Editor::marker_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
show_verbose_time_cursor (newframe, 10);
#ifdef GTKOSX
track_canvas->update_now ();
flush_canvas ();
#endif
}
@ -3273,7 +3273,7 @@ Editor::start_region_grab (ArdourCanvas::Item* item, GdkEvent* event)
_region_motion_group->raise_to_top ();
/* sync the canvas to what we think is its current state */
track_canvas->update_now();
flush_canvas ();
}
void
@ -3399,7 +3399,7 @@ Editor::possibly_copy_regions_during_grab (GdkEvent* event)
..only if the mouse is in rapid motion at the time of the grab.
something to do with regionview creation raking so long?
*/
track_canvas->update_now();
flush_canvas ();
}
}
@ -4018,7 +4018,7 @@ Editor::region_drag_finished_callback (ArdourCanvas::Item* item, GdkEvent* event
drag_delta = clicked_regionview->region()->position() - drag_info.last_frame_position;
track_canvas->update_now ();
flush_canvas ();
for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ) {

View file

@ -114,7 +114,6 @@ Editor::handle_gui_changes (const string & what, void *src)
/* Optional :make tracks change height while it happens, instead
of on first-idle
*/
//track_canvas->update_now ();
redisplay_route_list ();
}