recreate the dialog if the Popup flag changes
a popup only works if it's created with that flag from the beginning
This commit is contained in:
parent
fb42ef0df4
commit
9726906ed0
@ -194,7 +194,6 @@ void DialogProxy::setVisible(const bool visible)
|
||||
if (m_dialog->isVisible() != visible) {
|
||||
m_dialog->setVisible(visible);
|
||||
if (visible) {
|
||||
m_dialog->setWindowFlags(Qt::FramelessWindowHint|m_flags);
|
||||
m_dialog->setVisible(visible);
|
||||
m_dialog->raise();
|
||||
}
|
||||
@ -339,13 +338,22 @@ void DialogProxy::activateWindow()
|
||||
|
||||
int DialogProxy::windowFlags() const
|
||||
{
|
||||
return (int)m_dialog->windowFlags();
|
||||
return (int)m_flags;
|
||||
}
|
||||
|
||||
void DialogProxy::setWindowFlags(const int flags)
|
||||
{
|
||||
m_flags = (Qt::WindowFlags)flags;
|
||||
m_dialog->setWindowFlags((Qt::WindowFlags)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);
|
||||
}
|
||||
}
|
||||
|
||||
int DialogProxy::location() const
|
||||
|
Loading…
x
Reference in New Issue
Block a user