summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorSilarn <jrim@rimpo.org>2019-07-04 15:09:49 -0500
committerSilarn <jrim@rimpo.org>2019-07-04 15:09:49 -0500
commit7879ea2c623521115eafeef4ad788eef8c18cc2c (patch)
tree6afeda5bee32d69b55c38db54e6626779dee45fd /src/mainwindow.cpp
parentccc0653ca1a406e6994a17c1f6a01b2b6224c86e (diff)
Fix issue if widget isn't on a window
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 9726b27b..6c6eeee7 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1339,7 +1339,12 @@ void MainWindow::displaySaveGameInfo(QListWidgetItem *newItem)
}
m_CurrentSaveView->setSave(save);
- QRect screenRect = m_CurrentSaveView->window()->windowHandle()->screen()->geometry();
+ QWindow *window = m_CurrentSaveView->window()->windowHandle();
+ QRect screenRect;
+ if (window == nullptr)
+ screenRect = QGuiApplication::primaryScreen()->geometry();
+ else
+ screenRect = window->screen()->geometry();
QPoint pos = QCursor::pos();
if (pos.x() + m_CurrentSaveView->width() > screenRect.right()) {