diff --git a/popupapplet.cpp b/popupapplet.cpp index 95779b035..9d4a46523 100644 --- a/popupapplet.cpp +++ b/popupapplet.cpp @@ -275,13 +275,8 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints) //stuff out of your Dialog (extenders). Monitor WindowDeactivate events so we can //emulate the same kind of behavior as Qt::Popup (close when you click somewhere //else. - Qt::WindowFlags wflags = Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint; - - if (passive) { - wflags |= Qt::X11BypassWindowManagerHint; - } - - dialog->setWindowFlags(wflags); + dialog->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); + updateDialogFlags(); KWindowSystem::setState(dialog->winId(), NET::SkipTaskbar | NET::SkipPager); dialog->installEventFilter(q); @@ -339,7 +334,7 @@ void PopupApplet::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) bool PopupApplet::eventFilter(QObject *watched, QEvent *event) { - if (watched == d->dialog && (event->type() == QEvent::WindowDeactivate)) { + if (!d->passive && watched == d->dialog && (event->type() == QEvent::WindowDeactivate)) { d->popupLostFocus = true; hidePopup(); QTimer::singleShot(100, this, SLOT(clearPopupLostFocus())); @@ -410,15 +405,7 @@ void PopupApplet::setPassivePopup(bool passive) d->passive = passive; if (d->dialog) { - Qt::WindowFlags wflags = d->dialog->windowFlags(); - - if (d->passive) { - wflags |= Qt::X11BypassWindowManagerHint; - } else { - wflags &= ~Qt::X11BypassWindowManagerHint; - } - - d->dialog->setWindowFlags(wflags); + d->updateDialogFlags(); } } @@ -627,6 +614,15 @@ void PopupAppletPrivate::updateDialogPosition() dialog->move(pos); } + + +void PopupAppletPrivate::updateDialogFlags() +{ + Q_ASSERT(dialog); + dialog->setAttribute(Qt::WA_X11NetWmWindowTypeNotification, passive); +} + + } // Plasma namespace #include "popupapplet.moc" diff --git a/private/popupapplet_p.h b/private/popupapplet_p.h index e0bc44fe4..7301b64b3 100644 --- a/private/popupapplet_p.h +++ b/private/popupapplet_p.h @@ -35,6 +35,7 @@ public: void dialogSizeChanged(); void dialogStatusChanged(bool status); void updateDialogPosition(); + void updateDialogFlags(); void popupConstraintsEvent(Plasma::Constraints constraints); void checkExtenderAppearance(Plasma::FormFactor f);