QtWidgets: Suppress QEvent::WindowActivate when minimized

Prevent call to activateWindow() for minimized windows in
QWidget::setWindowState() by clearing the flag.

Fixes: QTBUG-46763
Change-Id: I40389d0906438ffe251fc79f18a523ecb53edb1b
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This commit is contained in:
Friedemann Kleint 2015-07-07 16:18:16 +02:00
parent ffac899576
commit 95ac2072bb

View File

@ -2914,6 +2914,8 @@ void QWidget::setWindowState(Qt::WindowStates newstate)
{ {
Q_D(QWidget); Q_D(QWidget);
Qt::WindowStates oldstate = windowState(); Qt::WindowStates oldstate = windowState();
if (newstate.testFlag(Qt::WindowMinimized)) // QTBUG-46763
newstate.setFlag(Qt::WindowActive, false);
if (oldstate == newstate) if (oldstate == newstate)
return; return;
if (isWindow() && !testAttribute(Qt::WA_WState_Created)) if (isWindow() && !testAttribute(Qt::WA_WState_Created))