Do not let plasma popup appear over screensaver.

BUG: 179924


CCMAIL:aseigo@kde.org

svn path=/branches/KDE/4.2/kdelibs/; revision=956998
This commit is contained in:
Aurélien Gâteau 2009-04-21 09:20:10 +00:00
parent 76b571b6bc
commit 259e98fdfc
2 changed files with 14 additions and 17 deletions

View File

@ -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"

View File

@ -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);