Hide the root canvas if we have saved the position and size of other canvases and...
[synfig.git] / synfig-studio / trunk / src / gtkmm / app.cpp
index 69aa237..27a7373 100644 (file)
@@ -7,6 +7,7 @@
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
 **     Copyright (c) 2007, 2008 Chris Moore
+**     Copyright (c) 2008 Gerald Young
 **
 **     This package is free software; you can redistribute it and/or
 **     modify it under the terms of the GNU General Public License as
@@ -1349,12 +1350,13 @@ App::set_recent_file_window_size(etl::handle<Instance> instance)
                return;
 
        synfig::String::size_type current=0;
+       bool seen_root(false), shown_non_root(false);
 
        while(current != synfig::String::npos)
        {
                // find end of first field (canvas) or return
                synfig::String::size_type separator = canvas_window_size.find_first_of(' ', current);
-               if(separator == synfig::String::npos) return;
+               if(separator == synfig::String::npos) break;
 
                // find the canvas
                synfig::Canvas::Handle canvas;
@@ -1372,6 +1374,11 @@ App::set_recent_file_window_size(etl::handle<Instance> instance)
                CanvasView::Handle canvasview = instance->find_canvas_view(canvas);
                canvasview->present();
 
+               if (canvas->is_root())
+                       seen_root = true;
+               else
+                       shown_non_root = true;
+
                // check that we have the tab character the ends this canvas' data or return
                current = separator+1;
                separator = canvas_window_size.find_first_of('\t', current);
@@ -1403,6 +1410,9 @@ App::set_recent_file_window_size(etl::handle<Instance> instance)
 
                current = separator+1;
        }
+
+       if (shown_non_root && !seen_root)
+               instance->find_canvas_view(instance->get_canvas())->hide();
 }
 
 void