Implement the recommendations from https://wiki.gnome.org/HowDoI/SaveWindowState in the Application Class example.