From e8e3f323f59813a81a5209efc474657bce8f215b Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Sat, 23 Jan 2010 17:47:44 -0200 Subject: [PATCH] Proper restoration of the window size/position --- mitterlib/ui/ui_pygtk.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/mitterlib/ui/ui_pygtk.py b/mitterlib/ui/ui_pygtk.py index 675652a..a636ec3 100644 --- a/mitterlib/ui/ui_pygtk.py +++ b/mitterlib/ui/ui_pygtk.py @@ -638,7 +638,6 @@ class Interface(object): def _window_to_tray(self, statusicon, user_data=None): """Minimize/display main window (as in minimize to tray.)""" if self._main_window.get_property('visible'): - self._main_window.hide_all() (x, y) = self._main_window.get_position() _log.debug('Current position: %d x %d', x, y) self._options[self.NAMESPACE]['position_x'] = x @@ -648,12 +647,21 @@ class Interface(object): _log.debug('Current window size: %d x %d', width, height) self._options[self.NAMESPACE]['width'] = width self._options[self.NAMESPACE]['height'] = height + + self._main_window.hide_all() else: + _log.debug('Size: %d x %d', + self._options[self.NAMESPACE]['width'], + self._options[self.NAMESPACE]['height']) + _log.debug('Position: %d x %d', + self._options[self.NAMESPACE]['position_x'], + self._options[self.NAMESPACE]['position_y']) + self._main_window.show_all() - main_window.resize( + self._main_window.resize( self._options[self.NAMESPACE]['width'], self._options[self.NAMESPACE]['height']) - main_window.move( + self._main_window.move( self._options[self.NAMESPACE]['position_x'], self._options[self.NAMESPACE]['position_y']) return