13
0

Hopefully fix assertion failures in gnomecanvas when dragging track heights.

git-svn-id: svn://localhost/ardour2/branches/3.0@5175 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2009-06-12 19:05:16 +00:00
parent e2601b67ff
commit 8eb17211b5
5 changed files with 28 additions and 9 deletions

View File

@ -2219,6 +2219,8 @@ public:
EditorSummary* _summary;
void region_view_added (RegionView *);
void update_canvas_now ();
friend class Drag;
friend class RegionDrag;
friend class RegionMoveDrag;

View File

@ -819,7 +819,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 ();
update_canvas_now ();
}
void
@ -889,8 +889,25 @@ void
Editor::flush_canvas ()
{
if (is_mapped()) {
track_canvas->update_now ();
update_canvas_now ();
// gdk_window_process_updates (GTK_LAYOUT(track_canvas->gobj())->bin_window, true);
}
}
void
Editor::update_canvas_now ()
{
/* 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

@ -798,7 +798,7 @@ RegionMoveDrag::finished (GdkEvent* event, bool movement_occurred)
drag_delta = _primary->region()->position() - _last_frame_position;
_editor->track_canvas->update_now ();
_editor->update_canvas_now ();
/* make a list of where each region ended up */
final = find_time_axis_views ();
@ -1066,7 +1066,7 @@ RegionMotionDrag::copy_regions (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?
*/
_editor->track_canvas->update_now();
_editor->update_canvas_now();
}
bool
@ -1255,7 +1255,7 @@ RegionMotionDrag::find_time_axis_views ()
void
RegionInsertDrag::finished (GdkEvent* event, bool movement_occurred)
{
_editor->track_canvas->update_now ();
_editor->update_canvas_now ();
map<RegionView*, RouteTimeAxisView*> final = find_time_axis_views ();
@ -1893,7 +1893,7 @@ CursorDrag::motion (GdkEvent* event, bool)
_editor->show_verbose_time_cursor (_cursor->current_frame, 10);
#ifdef GTKOSX
_editor->track_canvas->update_now ();
_editor->update_canvas_now ();
#endif
_editor->UpdateAllTransportClocks (_cursor->current_frame);
@ -2355,7 +2355,7 @@ MarkerDrag::motion (GdkEvent* event, bool)
_editor->show_verbose_time_cursor (newframe, 10);
#ifdef GTKOSX
_editor->track_canvas->update_now ();
_editor->update_canvas_now ();
#endif
_editor->edit_point_clock.set (copy_location->start());
}

View File

@ -2550,7 +2550,7 @@ Editor::start_region_grab (ArdourCanvas::Item* item, GdkEvent* event, RegionView
begin_reversible_command (_("move region(s)"));
/* sync the canvas to what we think is its current state */
track_canvas->update_now();
update_canvas_now();
}
void

View File

@ -158,7 +158,7 @@ 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 ();
//update_canvas_now ();
redisplay_route_list ();
}