summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qplatformwindow.cpp')
-rw-r--r--src/gui/kernel/qplatformwindow.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp
index 167bd44f0e..763ab68868 100644
--- a/src/gui/kernel/qplatformwindow.cpp
+++ b/src/gui/kernel/qplatformwindow.cpp
@@ -83,7 +83,8 @@ QPlatformWindow *QPlatformWindow::parent() const
*/
QPlatformScreen *QPlatformWindow::screen() const
{
- return window()->screen()->handle();
+ QScreen *scr = window()->screen();
+ return scr ? scr->handle() : Q_NULLPTR;
}
/*!
@@ -479,7 +480,7 @@ QString QPlatformWindow::formatWindowTitle(const QString &title, const QString &
QPlatformScreen *QPlatformWindow::screenForGeometry(const QRect &newGeometry) const
{
QPlatformScreen *currentScreen = screen();
- if (!parent() && !currentScreen->geometry().intersects(newGeometry)) {
+ if (!parent() && currentScreen && !currentScreen->geometry().intersects(newGeometry)) {
Q_FOREACH (QPlatformScreen* screen, currentScreen->virtualSiblings()) {
if (screen->geometry().intersects(newGeometry))
return screen;