all repos — mgba @ acbd8a3688703772861241a9b87f08cf91a0f66d

mGBA Game Boy Advance Emulator

Qt: Prevent window from being created off-screen
Vicki Pfau vi@endrift.com
Mon, 16 Oct 2017 20:24:34 -0700
commit

acbd8a3688703772861241a9b87f08cf91a0f66d

parent

a6911437773cadc3708f92b16813b3d635dc1d65

2 files changed, 4 insertions(+), 2 deletions(-)

jump to
M CHANGESCHANGES

@@ -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.cppsrc/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) {