[pitivi] mainwindow: Fix main window getting bigger between restarts



commit d5eab666ecbd82da85601959d1a89210140d0f6c
Author: Alexandru Băluț <alexandru balut gmail com>
Date:   Wed Jun 22 17:01:41 2016 +0200

    mainwindow: Fix main window getting bigger between restarts
    
    Seems the event's width and height included the window decorations and
    that was not good.
    
    Differential Revision: https://phabricator.freedesktop.org/D1105

 pitivi/mainwindow.py |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/pitivi/mainwindow.py b/pitivi/mainwindow.py
index 7bd73df..7d31603 100644
--- a/pitivi/mainwindow.py
+++ b/pitivi/mainwindow.py
@@ -495,14 +495,17 @@ class MainWindow(Gtk.ApplicationWindow, Loggable):
 
 # UI Callbacks
 
-    def _configureCb(self, unused_widget, event):
-        """Handles the main window being moved, resized or maximized."""
-        # get_position() takes window manager decoration into account
+    def _configureCb(self, unused_widget, unused_event):
+        """Saves the main window position and size."""
+        # Takes window manager decorations into account.
         position = self.get_position()
-        self.settings.mainWindowWidth = event.width
-        self.settings.mainWindowHeight = event.height
-        self.settings.mainWindowX = position[0]
-        self.settings.mainWindowY = position[1]
+        self.settings.mainWindowX = position.root_x
+        self.settings.mainWindowY = position.root_y
+
+        # Does not include the size of the window manager decorations.
+        size = self.get_size()
+        self.settings.mainWindowWidth = size.width
+        self.settings.mainWindowHeight = size.height
 
     def _deleteCb(self, unused_widget, unused_data=None):
         self._saveWindowSettings()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]