set default window position before and after showing window

This commit is contained in:
Josh Holtrop 2016-06-27 12:49:52 -04:00
parent c986cf3da1
commit ff52d1490a

View File

@ -51,11 +51,10 @@ class MainWindow(Gtk.Window):
self.add(vbox) self.add(vbox)
self.connect("delete-event", self.__close) self.connect("delete-event", self.__close)
self.show_all()
if (self.cache_file["x"] is not None and self.__set_default_window_position()
self.cache_file["y"] is not None): self.show_all()
self.move(self.cache_file["x"], self.cache_file["y"]) self.__set_default_window_position()
self.__go(url) self.__go(url)
@ -77,6 +76,11 @@ class MainWindow(Gtk.Window):
Gtk.main_quit() Gtk.main_quit()
return True return True
def __set_default_window_position(self):
if (self.cache_file["x"] is not None and
self.cache_file["y"] is not None):
self.move(self.cache_file["x"], self.cache_file["y"])
def __refresh(self, url): def __refresh(self, url):
self.__refresh_repo_root(url) self.__refresh_repo_root(url)
if self.repo_root is not None: if self.repo_root is not None: