Fix window growing each start

As described in bug 771290, the window got slightly larger each time
gitg was run.  This was due to the way we accidentally mixed APIs when
saving/restoring the window size.

To fix this, use GtkWindow methods when saving the window size.  This
is consistent with our prior use of GtkWindow methods to set the window
size on startup.

https://bugzilla.gnome.org/show_bug.cgi?id=771290
This commit is contained in:
Clayton G. Hobbs 2016-10-09 16:26:45 -04:00 committed by Alberto Fanjul
parent 4ce63eeb37
commit ec8d97d5c4

View file

@ -603,7 +603,9 @@ public class Window : Gtk.ApplicationWindow, GitgExt.Application, Initable
{
if (this.get_realized() && !(Gdk.WindowState.MAXIMIZED in get_window().get_state()))
{
d_state_settings.set("size", "(ii)", event.width, event.height);
int width, height;
get_size(out width, out height);
d_state_settings.set("size", "(ii)", width, height);
}
return base.configure_event(event);