From: dooglus Date: Fri, 12 Oct 2007 15:15:31 +0000 (+0000) Subject: Close safely when closing from the caret menu as well as when clicking the 'X' or... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=426f5624c5e8e1d48a15316128149c26fba14e7c;p=synfig.git Close safely when closing from the caret menu as well as when clicking the 'X' or hitting alt-F4. git-svn-id: http://svn.voria.com/code@914 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/canvasview.cpp b/synfig-studio/trunk/src/gtkmm/canvasview.cpp index 14419be..b88484f 100644 --- a/synfig-studio/trunk/src/gtkmm/canvasview.cpp +++ b/synfig-studio/trunk/src/gtkmm/canvasview.cpp @@ -1942,7 +1942,16 @@ CanvasView::refresh_rend_desc() bool CanvasView::close() { - get_instance()->safe_close(); + if (get_work_area()->get_updating()) + { + get_work_area()->stop_updating(true); // stop and mark as cancelled + + // give the workarea chances to stop updating + Glib::signal_timeout().connect(sigc::mem_fun(*this, &CanvasView::close_instance_when_safe) ,250); + return false; + } + + close_instance_when_safe(); return false; } @@ -3547,16 +3556,7 @@ CanvasView::close_instance_when_safe() bool CanvasView::on_delete_event(GdkEventAny* event) { - if (get_work_area()->get_updating()) - { - get_work_area()->stop_updating(true); // stop and mark as cancelled - - // give the workarea chances to stop updating - Glib::signal_timeout().connect(sigc::mem_fun(*this, &CanvasView::close_instance_when_safe) ,250); - return true; - } - - close_instance_when_safe(); + close(); //! \todo This causes the window to be deleted straight away - but what if we prompt 'save?' and the user cancels? // Is there ever any need to pass on the delete event to the window here?