From e91dafd7a91a4478e910cc14b8bc8b44e2424593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 10 Jul 2017 14:42:05 +0200 Subject: [PATCH] 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 Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/cocoa/qcocoawindow.mm | 16 ++++------------ 1 file 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()