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
parent
3e3466d28c
commit
e91dafd7a9
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in New Issue