X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fapp.cpp;h=653c19b032e4be392c7eedef5babb8705b4d2eb4;hb=282b5162f219e2114a59a00743180b45c238680f;hp=69aa23715fdb376afb9f7fd2a35c86442d1fbd51;hpb=e462a2e9e6c29d48dfc4cfe3c1ba55e1e728e32f;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/app.cpp b/synfig-studio/trunk/src/gtkmm/app.cpp index 69aa237..653c19b 100644 --- a/synfig-studio/trunk/src/gtkmm/app.cpp +++ b/synfig-studio/trunk/src/gtkmm/app.cpp @@ -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 @@ -30,6 +31,11 @@ # include #endif +#ifdef WIN32 +#define WINVER 0x0500 +#include +#endif + #include #include #include @@ -121,10 +127,6 @@ #include #endif -#ifdef WIN32 -#define _WIN32_WINNT 0x0500 -#include -#endif #include #include #include @@ -1349,12 +1351,13 @@ App::set_recent_file_window_size(etl::handle 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; @@ -1369,8 +1372,10 @@ App::set_recent_file_window_size(etl::handle instance) continue; } - 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; @@ -1392,17 +1397,20 @@ App::set_recent_file_window_size(etl::handle instance) x += atoi(getenv("SYNFIG_WINDOW_POSITION_X_OFFSET")); if(getenv("SYNFIG_WINDOW_POSITION_Y_OFFSET")) y += atoi(getenv("SYNFIG_WINDOW_POSITION_Y_OFFSET")); - canvasview->move(x,y); if (w > SCALE_FACTOR) w = 150; if (w < 0) w = 0; if (h > SCALE_FACTOR) h = 150; if (h < 0) h = 0; - w=w*screen_w/SCALE_FACTOR; - h=h*screen_h/SCALE_FACTOR; - canvasview->set_default_size(w,h); - canvasview->set_size_request(w,h); + + CanvasView::Handle canvasview = instance->find_canvas_view(canvas); + canvasview->move(x,y); + canvasview->resize(w*screen_w/SCALE_FACTOR,h*screen_h/SCALE_FACTOR); + canvasview->present(); current = separator+1; } + + if (shown_non_root && !seen_root) + instance->find_canvas_view(instance->get_canvas())->hide(); } void