elegantly work around

the hack
This commit is contained in:
Sebastian Kügler 2013-04-30 02:59:02 +02:00
parent b68317e930
commit 47c63deb6f

View File

@ -151,12 +151,8 @@ void DialogProxy::setVisible(const bool visible)
QRect avail; QRect avail;
if (visible) { if (visible) {
syncToMainItemSize(); syncToMainItemSize();
if (!m_visualParent.isNull()) { if (!m_visualParent.isNull() && m_visualParent.data()->window()) {
if (m_visualParent.data()->window()) { avail = m_visualParent.data()->window()->screen()->availableGeometry();
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) { if (location() == Plasma::FullScreen) {
m_frameSvgItem->setEnabledBorders(Plasma::FrameSvg::NoBorder); m_frameSvgItem->setEnabledBorders(Plasma::FrameSvg::NoBorder);
setGeometry(avail); setGeometry(avail);
@ -183,7 +179,7 @@ void DialogProxy::setVisible(const bool visible)
setPosition(popupPosition(m_visualParent.data(), Qt::AlignCenter)); setPosition(popupPosition(m_visualParent.data(), Qt::AlignCenter));
} }
} else { } else {
// no visual parent -> center on screen // no visual parent or window -> center on screen
setPosition((avail.width() - width()) / 2, (avail.height() - height()) / 2); setPosition((avail.width() - width()) / 2, (avail.height() - height()) / 2);
} }
raise(); raise();