Prevent activation of windows with Qt::WindowDoesNotAcceptFocus.

Task-number: QTBUG-32385
Change-Id: I307e2a3e5157b351663940d5d02fc16b3127b5dd
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
This commit is contained in:
Friedemann Kleint 2013-07-17 13:26:55 +02:00 committed by The Qt Project
parent b02eb3b436
commit a0996b8b60
2 changed files with 6 additions and 1 deletions

View File

@ -871,6 +871,10 @@ QRegion QWindow::mask() const
void QWindow::requestActivate()
{
Q_D(QWindow);
if (flags() & Qt::WindowDoesNotAcceptFocus) {
qWarning() << "requestActivate() called for " << this << " which has Qt::WindowDoesNotAcceptFocus set.";
return;
}
if (d->platformWindow)
d->platformWindow->requestActivateWindow();
}

View File

@ -1643,7 +1643,8 @@ void QXcbWindow::handleButtonPressEvent(const xcb_button_press_event_t *event)
{
if (window() != QGuiApplication::focusWindow()) {
QWindow *w = static_cast<QWindowPrivate *>(QObjectPrivate::get(window()))->eventReceiver();
w->requestActivate();
if (!(w->flags() & Qt::WindowDoesNotAcceptFocus))
w->requestActivate();
}
updateNetWmUserTime(event->time);