Fix #504 disconnected monitor bug (#505)

* Fix #504 disconnected monitor bug
This commit is contained in:
Etoh 2022-03-04 14:07:46 +00:00 committed by GitHub
parent 1404d58740
commit e4322e1093
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -2057,7 +2057,12 @@ class MainWindow(QtWidgets.QMainWindow):
settings = QSettings("Syncplay", "MainWindow") settings = QSettings("Syncplay", "MainWindow")
settings.beginGroup("MainWindow") settings.beginGroup("MainWindow")
self.resize(settings.value("size", QSize(700, 500))) self.resize(settings.value("size", QSize(700, 500)))
self.move(settings.value("pos", QPoint(200, 200))) movePos = settings.value("pos", QPoint(200, 200))
windowGeometry = QtWidgets.QApplication.desktop().availableGeometry(self)
posIsOnScreen = windowGeometry.contains(QtCore.QRect(movePos.x(), movePos.y(), 1, 1))
if not posIsOnScreen:
movePos = QPoint(200,200)
self.move(movePos)
if settings.value("showPlaybackButtons", "false") == "true": if settings.value("showPlaybackButtons", "false") == "true":
self.playbackAction.setChecked(True) self.playbackAction.setChecked(True)
self.updatePlaybackFrameVisibility() self.updatePlaybackFrameVisibility()