mirror of https://github.com/mgba-emu/mgba.git
Qt: Prevent window from being created off-screen
This commit is contained in:
parent
a691143777
commit
acbd8a3688
1
CHANGES
1
CHANGES
|
@ -28,6 +28,7 @@ Misc:
|
||||||
- Python: Integrate tests from cinema test suite
|
- Python: Integrate tests from cinema test suite
|
||||||
- Util: Don't build crc32 if the function already exists
|
- Util: Don't build crc32 if the function already exists
|
||||||
- GBA: Implement display start DMAs
|
- GBA: Implement display start DMAs
|
||||||
|
- Qt: Prevent window from being created off-screen
|
||||||
|
|
||||||
0.6.1: (2017-10-01)
|
0.6.1: (2017-10-01)
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
|
|
@ -550,11 +550,12 @@ void Window::showEvent(QShowEvent* event) {
|
||||||
m_wasOpened = true;
|
m_wasOpened = true;
|
||||||
resizeFrame(m_screenWidget->sizeHint());
|
resizeFrame(m_screenWidget->sizeHint());
|
||||||
QVariant windowPos = m_config->getQtOption("windowPos");
|
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());
|
move(windowPos.toPoint());
|
||||||
} else {
|
} else {
|
||||||
QRect rect = frameGeometry();
|
QRect rect = frameGeometry();
|
||||||
rect.moveCenter(QApplication::desktop()->availableGeometry().center());
|
rect.moveCenter(geom.center());
|
||||||
move(rect.topLeft());
|
move(rect.topLeft());
|
||||||
}
|
}
|
||||||
if (m_fullscreenOnStart) {
|
if (m_fullscreenOnStart) {
|
||||||
|
|
Loading…
Reference in New Issue