summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-05-04 15:27:23 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-05-04 15:27:23 +0000
commit9a61a9b0bfe618ee33c08aa751fc16502e97886f (patch)
treeab4f1d68d5baaf15b562800ba232408d82efd803
parent1f3024c32421d82bccd230bc773549d02d2cfa03 (diff)
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
-rw-r--r--gtk2_ardour/editor_canvas.cc18
-rw-r--r--gtk2_ardour/editor_mouse.cc10
-rw-r--r--gtk2_ardour/editor_route_list.cc1
3 files changed, 20 insertions, 9 deletions
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc
index 878967fb6b..a029c6582d 100644
--- a/gtk2_ardour/editor_canvas.cc
+++ b/gtk2_ardour/editor_canvas.cc
@@ -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 ();
+ }
}
}
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index a2ba0476a0..15f8b235e2 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -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(); ) {
diff --git a/gtk2_ardour/editor_route_list.cc b/gtk2_ardour/editor_route_list.cc
index 583b6ec8e7..d73c8176ea 100644
--- a/gtk2_ardour/editor_route_list.cc
+++ b/gtk2_ardour/editor_route_list.cc
@@ -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 ();
}