diff options
author | Carl Hetherington <carl@carlh.net> | 2009-06-12 19:05:16 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-06-12 19:05:16 +0000 |
commit | 8eb17211b5d8adab6057ff335c2050b156f91edd (patch) | |
tree | 544568689e4006c611d952e8a4dca03039fb1587 /gtk2_ardour/editor_canvas.cc | |
parent | e2601b67ff8b183546ab7fbf0c00af8cdb4b15b0 (diff) |
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
Diffstat (limited to 'gtk2_ardour/editor_canvas.cc')
-rw-r--r-- | gtk2_ardour/editor_canvas.cc | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc index 573b3af16a..6698c5ee9b 100644 --- a/gtk2_ardour/editor_canvas.cc +++ b/gtk2_ardour/editor_canvas.cc @@ -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 (); + } +} |