diff --git a/sugar/shell/WindowManager.py b/sugar/shell/WindowManager.py index 2f645475..2ae1cba4 100644 --- a/sugar/shell/WindowManager.py +++ b/sugar/shell/WindowManager.py @@ -90,19 +90,19 @@ class WindowManager: if self._width_type is WindowManager.ABSOLUTE: width = self._width elif self._width_type is WindowManager.SCREEN_RELATIVE: - width = screen_width * self._width + width = int(screen_width * self._width) if self._height_type is WindowManager.ABSOLUTE: height = self._height elif self._height_type is WindowManager.SCREEN_RELATIVE: - height = screen_height * self._height + height = int(screen_height * self._height) if self._position is WindowManager.CENTER: - x = (screen_width - width) / 2 - y = (screen_height - height) / 2 + x = int((screen_width - width) / 2) + y = int((screen_height - height) / 2) elif self._position is WindowManager.LEFT: x = 0 - y = (screen_height - height) / 2 + y = int((screen_height - height) / 2) self._window.move(x, y) self._window.resize(width, height)