From 8a04030fdff985175ce0a1ad5dce4bfdd5a7a368 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 12 Jul 2012 17:49:08 +0200 Subject: [PATCH] less ugly workaround for disappearing Qt::Popup still a workaround but slightly less ugly and works on Qt 4.8 too --- declarativeimports/core/dialog.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/declarativeimports/core/dialog.cpp b/declarativeimports/core/dialog.cpp index 81de30b68..a15e354ed 100644 --- a/declarativeimports/core/dialog.cpp +++ b/declarativeimports/core/dialog.cpp @@ -197,9 +197,11 @@ bool DialogProxy::isVisible() const void DialogProxy::setVisible(const bool visible) { if (m_dialog->isVisible() != visible) { + //FIXME: workaround to prevent dialogs of Popup type disappearing on the second show + m_dialog->resize(0,0); + m_dialog->syncToGraphicsWidget(); m_dialog->setVisible(visible); if (visible) { - m_dialog->setVisible(visible); m_dialog->raise(); } } @@ -359,17 +361,8 @@ qulonglong DialogProxy::windowId() const void DialogProxy::setWindowFlags(const int flags) { - /*X misbehaviour: the only way to make a window with the Popup flag working, is to create it with that flag from the beginning*/ - if (((Qt::WindowFlags)flags & Qt::Popup) != (m_flags & Qt::Popup)) { - delete m_dialog; - m_flags = (Qt::WindowFlags)flags; - m_dialog = new Plasma::Dialog(0, Qt::FramelessWindowHint|m_flags); - m_margins = new DialogMargins(m_dialog, this); - m_dialog->installEventFilter(this); - } else { - m_flags = (Qt::WindowFlags)flags; - m_dialog->setWindowFlags(Qt::FramelessWindowHint|m_flags); - } + m_flags = (Qt::WindowFlags)flags; + m_dialog->setWindowFlags(Qt::FramelessWindowHint|m_flags); } int DialogProxy::location() const