summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-07-10 14:42:05 +0200
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2017-07-11 11:16:42 +0000
commite91dafd7a91a4478e910cc14b8bc8b44e2424593 (patch)
treeabe90cf0711bc01a408ecad8b228dd6c2d977f08 /src/plugins/platforms/cocoa
parent3e3466d28c470057b755e70e37bb950da62a206e (diff)
macOS: Don't special-case QTestLib when reacting to occlusion events
The tests (and Qt) should be able to handle occlusion of windows. Change-Id: I5e93e032f6a5282f19a20d0e230863d2a165f4e3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index b2b522e824..5d03e0e8e9 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -976,18 +976,10 @@ void QCocoaWindow::windowDidOrderOnScreen()
void QCocoaWindow::windowDidChangeOcclusionState()
{
- // Several unit tests expect paint and/or expose events for windows that are
- // sometimes (unpredictably) occluded and some unit tests depend on QWindow::isExposed.
- // Don't send Expose/Obscure events when running under QTestLib.
- static const bool onTestLib = qt_mac_resolveOption(false, "QT_QTESTLIB_RUNNING");
- if (!onTestLib) {
- if ((NSUInteger)[m_view.window occlusionState] & NSWindowOcclusionStateVisible) {
- exposeWindow();
- } else {
- // Send Obscure events on window occlusion to stop animations.
- obscureWindow();
- }
- }
+ if (m_view.window.occlusionState & NSWindowOcclusionStateVisible)
+ exposeWindow();
+ else
+ obscureWindow();
}
void QCocoaWindow::windowDidChangeScreen()