summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qmdisubwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/qmdisubwindow.cpp')
-rw-r--r--src/gui/widgets/qmdisubwindow.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/widgets/qmdisubwindow.cpp b/src/gui/widgets/qmdisubwindow.cpp
index 6516fba..61ea385 100644
--- a/src/gui/widgets/qmdisubwindow.cpp
+++ b/src/gui/widgets/qmdisubwindow.cpp
@@ -160,6 +160,7 @@
#include <QMainWindow>
#include <QScrollBar>
#include <QDebug>
+#include <QScopedValueRollback>
#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
#include <QMacStyle>
#endif
@@ -2795,6 +2796,10 @@ bool QMdiSubWindow::event(QEvent *event)
bool wasShaded = isShaded();
bool wasMinimized = isMinimized();
bool wasMaximized = isMaximized();
+ // Don't emit subWindowActivated, the app doesn't have to know about our hacks
+ const QScopedValueRollback<bool> activationEnabledSaver(d->activationEnabled);
+ d->activationEnabled = false;
+
ensurePolished();
setContentsMargins(0, 0, 0, 0);
if (wasMinimized || wasMaximized || wasShaded)
@@ -3014,7 +3019,8 @@ void QMdiSubWindow::changeEvent(QEvent *changeEvent)
if (d->isActive)
d->ensureWindowState(Qt::WindowActive);
- emit windowStateChanged(oldState, windowState());
+ if (d->activationEnabled)
+ emit windowStateChanged(oldState, windowState());
}
/*!