Qt: Prevent window from being created off-screen
Vicki Pfau vi@endrift.com
Mon, 16 Oct 2017 20:24:34 -0700
2 files changed,
4 insertions(+),
2 deletions(-)
M
CHANGES
→
CHANGES
@@ -28,6 +28,7 @@ - Test: Restructure test suite into multiple executables
- Python: Integrate tests from cinema test suite - Util: Don't build crc32 if the function already exists - GBA: Implement display start DMAs + - Qt: Prevent window from being created off-screen 0.6.1: (2017-10-01) Bugfixes:
M
src/platform/qt/Window.cpp
→
src/platform/qt/Window.cpp
@@ -550,11 +550,12 @@ }
m_wasOpened = true; resizeFrame(m_screenWidget->sizeHint()); QVariant windowPos = m_config->getQtOption("windowPos"); - if (!windowPos.isNull()) { + QRect geom = QApplication::desktop()->availableGeometry(this); + if (!windowPos.isNull() && geom.contains(windowPos.toPoint())) { move(windowPos.toPoint()); } else { QRect rect = frameGeometry(); - rect.moveCenter(QApplication::desktop()->availableGeometry().center()); + rect.moveCenter(geom.center()); move(rect.topLeft()); } if (m_fullscreenOnStart) {