X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fworkarea.cpp;h=dce50cdd1ba55a45cdb4dc88f2f4859fcf1590b4;hb=5442b08724a36e90837ca46f17660c8b3031beeb;hp=a6ca612562e375f1d5352e82381071907404f67d;hpb=65fb935293f8601f3042482dddc35a21eaa46d87;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/workarea.cpp b/synfig-studio/trunk/src/gtkmm/workarea.cpp index a6ca612..dce50cd 100644 --- a/synfig-studio/trunk/src/gtkmm/workarea.cpp +++ b/synfig-studio/trunk/src/gtkmm/workarea.cpp @@ -800,6 +800,15 @@ WorkArea::WorkArea(etl::loose_handle canvas_interfac WorkArea::~WorkArea() { // delete [] buffer; + + // don't leave the render function queued if we are about to vanish; + // that causes crashes + if(render_idle_func_id) + { + synfig::info("g_source_remove() returns %d", g_source_remove(render_idle_func_id)); + render_idle_func_id=0; + } else + synfig::info("no render_idle_func_id to clear\n"); } void @@ -2048,7 +2057,6 @@ WorkArea::refresh(GdkEventExpose*event) } } - // Calculate the window coordinates of the top-left // corner of the canvas. //const synfig::Vector::value_type @@ -2062,11 +2070,10 @@ WorkArea::refresh(GdkEventExpose*event) Glib::RefPtr gc=Gdk::GC::create(drawing_area->get_window()); - - // If we are in animate mode, draw a red border around the screen if(canvas_interface->get_mode()&synfigapp::MODE_ANIMATE) { +// #define USE_FRAME_BACKGROUND_TO_SHOW_EDIT_MODE #ifdef USE_FRAME_BACKGROUND_TO_SHOW_EDIT_MODE // This method of drawing the red border doesn't work on any // Gtk theme which uses the crux-engine, hcengine, industrial, @@ -2084,10 +2091,10 @@ WorkArea::refresh(GdkEventExpose*event) drawing_area->get_width()-1,drawing_area->get_height()-1); // w,h #endif } +#ifdef USE_FRAME_BACKGROUND_TO_SHOW_EDIT_MODE else drawing_frame->unset_bg(Gtk::STATE_NORMAL); - - +#endif previous_focus=get_focus_point(); @@ -2499,9 +2506,11 @@ studio::WorkArea::zoom_norm() gboolean studio::WorkArea::__render_preview(gpointer data) { - WorkArea *work_area(static_cast(data)); + // there's no point anyone trying to cancel the timer now - it's gone off already + work_area->render_idle_func_id = 0; + work_area->queued=false; work_area->async_render_preview(work_area->get_canvas_view()->get_time());