diff --git a/docs/changes.txt b/docs/changes.txt index b86eb25e8f..6a35852c93 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -144,6 +144,7 @@ All (GUI): - Handle wxST_ELLIPSIZE_XXX styles in wxStaticText XRC handler (tm). - Add support for bitmaps to wxToggleButton XRC handler (tm). - Fix wxGCDC::SetDeviceClippingRegion(). +- Never restore size smaller than the best one in wxPersistentTLW. wxGTK: diff --git a/include/wx/persist/toplevel.h b/include/wx/persist/toplevel.h index 31912b3801..07c1d61ae2 100644 --- a/include/wx/persist/toplevel.h +++ b/include/wx/persist/toplevel.h @@ -116,7 +116,14 @@ public: } if ( hasSize ) + { + // a previous version of the program could have saved the window + // size which used to be big enough, but which is not big enough + // any more for the new version, so check that the size we restore + // doesn't cut off parts of the window + size.IncTo(tlw->GetBestSize()); tlw->SetSize(size); + } // note that the window can be both maximized and iconized bool maximized;