summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@theqtcompany.com>2015-12-09 13:18:17 +0100
committerMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2016-01-04 13:03:03 +0000
commitb12e876efce4309ed61c04b9232ee80ec64baddc (patch)
treeac0d96708f2c517620a77a26ba8727289d13d459 /src/plugins
parent5d849880f4225717b76fb95d9c6a5dd9614ac7be (diff)
tst_qwindow::isExposed - fix failing test on OS X
Change-Id: Ice25c8ffaaa4662b679ee829dc0a38834e3258b7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 3faa292ae0..0d80333e65 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -440,16 +440,17 @@ QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wobjc-method-access")
enum { NSWindowOcclusionStateVisible = 1UL << 1 };
#endif
- if ((NSUInteger)[self.window occlusionState] & NSWindowOcclusionStateVisible) {
- m_platformWindow->exposeWindow();
- } else {
- // Send Obscure events on window occlusion to stop animations. Several
- // unit tests expect paint and/or expose events for windows that are
- // sometimes (unpredictably) occlouded: Don't send Obscure events when
- // running under QTestLib.
- static bool onTestLib = qt_mac_resolveOption(false, "QT_QTESTLIB_RUNNING");
- if (!onTestLib)
+ // 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)[self.window occlusionState] & NSWindowOcclusionStateVisible) {
+ m_platformWindow->exposeWindow();
+ } else {
+ // Send Obscure events on window occlusion to stop animations.
m_platformWindow->obscureWindow();
+ }
}
#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_9
QT_WARNING_POP