-static bool _close_instance(etl::handle<Instance> instance)
-{
- etl::handle<Instance> argh(instance);
- instance->safe_close();
- synfig::info("closed");
- return false;
-}
-
-bool
-CanvasView::close_instance_when_safe()
-{
- if (get_work_area()->get_updating())
- return true;
-
- if(get_instance()->get_visible_canvases()==1)
- // Schedule a close to occur in a few moments
- Glib::signal_timeout().connect(
- sigc::bind(
- sigc::ptr_fun(_close_instance),
- (etl::handle<Instance>)get_instance()
- )
- ,250
- );
-
- return false;
-}
-