Skip to content

Commit 5b66892

Browse files
committed
Fix deprecation warning
1 parent b8a5c85 commit 5b66892

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def __init__(self, width, height, app, parent=None):
132132
parent=self)
133133

134134
# initialize application to middle of screen
135-
drect = QApplication.desktop().availableGeometry(self)
135+
drect = app.primaryScreen().availableGeometry()
136136
center = drect.center()
137137
self.move(center.x() - self.width()*0.5,
138138
center.y() - self.height()*0.5)
@@ -150,8 +150,8 @@ def __init__(self, width, height, app, parent=None):
150150
self.logger = config.getLogger(__name__)
151151

152152
self.gui_app = app
153-
self.desktop_width = app.desktop().screenGeometry().width()
154-
self.desktop_height = app.desktop().screenGeometry().height()
153+
self.desktop_width = drect.width()
154+
self.desktop_height = drect.height()
155155

156156
self.setWindowIcon(QtGui.QIcon(get_file(config.ICON_PATH)))
157157

0 commit comments

Comments
 (0)