From e4976005c65a3710cf194f36c7a6be549c8aa08a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20K=C3=BCgler?= Date: Tue, 30 Apr 2013 02:33:17 +0200 Subject: [PATCH] Fix crasher with 0x0 windows It can happen that the visualParent has no window attached, so don't access it. In this case, use the visualParent's geometry. --- src/declarativeimports/core/dialog.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/declarativeimports/core/dialog.cpp b/src/declarativeimports/core/dialog.cpp index ad59ad3a9..693792a88 100644 --- a/src/declarativeimports/core/dialog.cpp +++ b/src/declarativeimports/core/dialog.cpp @@ -152,7 +152,11 @@ void DialogProxy::setVisible(const bool visible) if (visible) { syncToMainItemSize(); if (!m_visualParent.isNull()) { - avail = m_visualParent.data()->window()->screen()->availableGeometry(); + if (m_visualParent.data()->window()) { + avail = m_visualParent.data()->window()->screen()->availableGeometry(); + } else { + avail = QRect(m_visualParent.data()->x(), m_visualParent.data()->y(), m_visualParent.data()->width(), m_visualParent.data()->height()); + } if (location() == Plasma::FullScreen) { m_frameSvgItem->setEnabledBorders(Plasma::FrameSvg::NoBorder); setGeometry(avail);