diff options
| author | John Smith <john.smith7545@yahoo.com> | 2012-08-30 00:22:17 +0000 |
|---|---|---|
| committer | John Smith <john.smith7545@yahoo.com> | 2012-08-30 00:22:17 +0000 |
| commit | a51385827276535559541fb2e4c5145876a7d08a (patch) | |
| tree | 34ed06d096b1bb02a3b7736c70e7d582346b0e35 /src/interface.cpp | |
| parent | Fix for 980520 : Conflicting accelerator keys (diff) | |
| download | inkscape-a51385827276535559541fb2e4c5145876a7d08a.tar.gz inkscape-a51385827276535559541fb2e4c5145876a7d08a.zip | |
Fix for 170550 : open blank document on 'close'
(bzr r11632)
Diffstat (limited to 'src/interface.cpp')
| -rw-r--r-- | src/interface.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/interface.cpp b/src/interface.cpp index 4b40d0bdd..71be84f59 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -314,6 +314,17 @@ sp_ui_close_view(GtkWidget */*widget*/) return; // Shutdown operation has been canceled, so do nothing } + // If closing the last document, open a new document so Inkscape doesn't quit. + std::list<SPDesktop *> desktops; + inkscape_get_all_desktops(desktops); + if (desktops.size() == 1) { + Glib::ustring templateUri = sp_file_default_template_uri(); + SPDocument *doc = SPDocument::createNewDoc( templateUri.c_str() , TRUE, true ); + dt->change_document(doc); + sp_namedview_window_from_document(dt); + return; + } + // Shutdown can proceed; use the stored reference to the desktop here instead of the current SP_ACTIVE_DESKTOP, // because the user might have changed the focus in the meantime (see bug #381357 on Launchpad) dt->destroyWidget(); |
