Do not let plasma popup appear over screensaver.

BUG: 179924

svn path=/trunk/KDE/kdelibs/; revision=955241
This commit is contained in:
Aurélien Gâteau 2009-04-17 08:45:46 +00:00
parent 63c009bf68
commit 7ff77020cc
2 changed files with 14 additions and 17 deletions

View File

@ -277,13 +277,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);
@ -342,7 +337,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()));
@ -461,15 +456,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();
}
}
@ -705,6 +692,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);