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>
bb10
Tor Arne Vestbø 2017-07-10 14:42:05 +02:00 committed by Timur Pocheptsov
parent 3e3466d28c
commit e91dafd7a9
1 changed files with 4 additions and 12 deletions

View File

@ -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()