Code

Also store the window's geometry when saving through the data-loss warning dialog...
authordvlierop2 <dvlierop2@users.sourceforge.net>
Mon, 25 May 2009 20:04:26 +0000 (20:04 +0000)
committerdvlierop2 <dvlierop2@users.sourceforge.net>
Mon, 25 May 2009 20:04:26 +0000 (20:04 +0000)
src/interface.cpp
src/ui/view/edit-widget.cpp
src/widgets/desktop-widget.cpp

index 9901c2d6978f6ab8ee5abe3e8e7a2de36559c9df..d628d964d3bc10bfc5e2e62546101d91de8fe7e4 100644 (file)
@@ -185,8 +185,6 @@ sp_create_window(SPViewWidget *vw, gboolean editable)
                 if (w>0 && h>0) {
                     x = MIN(gdk_screen_width() - w, x);
                     y = MIN(gdk_screen_height() - h, y);
-                }
-                if (w>0 && h>0) {
                     desktop->setWindowSize(w, h);
                 }
 
index f11fac4cd918b895950ffe4bc6fdaee80a550b06..b12d5adf74b1837af2a619a1d93e0d6f4d98a81a 100644 (file)
@@ -1220,6 +1220,7 @@ EditWidget::shutdown()
         {
             case Gtk::RESPONSE_YES:
                 sp_document_ref(doc);
+                sp_namedview_document_from_window(_desktop);
                 if (sp_file_save_document(*this, doc)) {
                     sp_document_unref(doc);
                 } else { // save dialog cancelled or save failed
@@ -1307,7 +1308,7 @@ EditWidget::requestCanvasUpdateAndWait()
 {
     requestCanvasUpdate();
 
-    while (gtk_events_pending()) 
+    while (gtk_events_pending())
       gtk_main_iteration_do(FALSE);
 }
 
@@ -1315,9 +1316,9 @@ void
 EditWidget::enableInteraction()
 {
   g_return_if_fail(_interaction_disabled_counter > 0);
-  
+
   _interaction_disabled_counter--;
-  
+
   if (_interaction_disabled_counter == 0) {
     this->set_sensitive(true);
   }
@@ -1329,7 +1330,7 @@ EditWidget::disableInteraction()
   if (_interaction_disabled_counter == 0) {
     this->set_sensitive(false);
   }
-  
+
   _interaction_disabled_counter++;
 }
 
@@ -1348,9 +1349,9 @@ EditWidget::deactivateDesktop()
 void
 EditWidget::viewSetPosition (Geom::Point p)
 {
-    // p -= _namedview->gridorigin;    
+    // p -= _namedview->gridorigin;
     /// \todo Why was the origin corrected for the grid origin? (johan)
-    
+
     double lo, up, pos, max;
     _top_ruler.get_range (lo, up, pos, max);
     _top_ruler.set_range (lo, up, p[Geom::X], max);
@@ -1363,7 +1364,7 @@ EditWidget::updateRulers()
 {
     //Geom::Point gridorigin = _namedview->gridorigin;
     /// \todo Why was the origin corrected for the grid origin? (johan)
-    
+
     Geom::Rect const viewbox = _svg_canvas.spobj()->getViewbox();
     double lo, up, pos, max;
     double const scale = _desktop->current_zoom();
index ab09dbe8a77441571c3ee577fec5d85672369044..f5e153a8e9246c87007336c5dc00ae680a7c392a 100644 (file)
@@ -854,6 +854,7 @@ SPDesktopWidget::shutdown()
                 Gtk::Window *window = (Gtk::Window*)gtk_object_get_data (GTK_OBJECT(this), "window");
 
                 sp_document_ref(doc);
+                sp_namedview_document_from_window(desktop);
                 if (sp_file_save_document(*window, doc)) {
                     sp_document_unref(doc);
                 } else { // save dialog cancelled or save failed