+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 ();
+ }
+}
+
+double
+Editor::horizontal_position () const
+{
+ return frame_to_unit (leftmost_frame);
+}
+
+void
+Editor::set_canvas_cursor (Gdk::Cursor* cursor, bool save)
+{
+ if (save) {
+ current_canvas_cursor = cursor;
+ }
+
+ Glib::RefPtr<Gdk::Window> win = track_canvas->get_window();
+
+ if (win) {
+ track_canvas->get_window()->set_cursor (*cursor);
+ }
+}
+
+bool
+Editor::track_canvas_key_press (GdkEventKey*)
+{
+ /* XXX: event does not report the modifier key pressed down, AFAICS, so use the Keyboard object instead */
+ if (mouse_mode == Editing::MouseZoom && Keyboard::the_keyboard().key_is_down (GDK_Control_L)) {
+ set_canvas_cursor (_cursors->zoom_out, true);
+ }
+
+ return false;
+}
+
+bool
+Editor::track_canvas_key_release (GdkEventKey*)
+{
+ if (mouse_mode == Editing::MouseZoom && !Keyboard::the_keyboard().key_is_down (GDK_Control_L)) {
+ set_canvas_cursor (_cursors->zoom_in, true);
+ }
+
+ return false;
+}