Already done.
The patch defines ToolbarSize but how would you fill the information? Actually, with the attached patch, real toolbar width and height is saved to session so you should get enough information about previous layout. With your approach, short \n short ==> short short. With real width, short\n short ==> short \n short. What do you think? Bo Index: src/session.C =================================================================== --- src/session.C (revision 16928) +++ src/session.C (working copy) @@ -334,12 +334,16 @@ int location; int posx; int posy; + int width; + int height; istringstream value(tmp.substr(pos + 3)); value >> state; value >> location; value >> posx; value >> posy; - toolbars[key] = ToolbarInfo(state, location, posx, posy); + value >> width; + value >> height; + toolbars[key] = ToolbarInfo(state, location, posx, posy, width, height); } else lyxerr[Debug::INIT] << "LyX: Warning: Ignore toolbar info: " << tmp << endl; } catch (...) { @@ -358,7 +362,9 @@ << static_cast<int>(tb->second.state) << " " << static_cast<int>(tb->second.location) << " " << tb->second.posx << " " - << tb->second.posy << '\n'; + << tb->second.posy << " " + << tb->second.width << " " + << tb->second.height << '\n'; } } Index: src/frontends/qt4/QLToolbar.C =================================================================== --- src/frontends/qt4/QLToolbar.C (revision 16928) +++ src/frontends/qt4/QLToolbar.C (working copy) @@ -246,6 +246,8 @@ // now because move(x,y) does not work for toolbar. info.posx = pos().x(); info.posy = pos().y(); + info.width = width(); + info.height = height(); } Index: src/session.h =================================================================== --- src/session.h (revision 16928) +++ src/session.h (working copy) @@ -258,13 +258,15 @@ public: /// ToolbarInfo() : - state(ON), location(NOTSET), posx(0), posy(0) { } + state(ON), location(NOTSET), posx(0), posy(0), width(0), height(0) { } /// - ToolbarInfo(int s, int loc, int x=0, int y=0) : + ToolbarInfo(int s, int loc, int x=0, int y=0, int w=0, int h=0) : state(static_cast<State>(s)), location(static_cast<Location>(loc)), posx(x), - posy(y) + posy(y), + width(w), + height(h) { } public: @@ -293,6 +295,12 @@ /// y-position of the toolbar int posy; + + /// width + int width; + + /// height + int height; /// potentially, icons };