diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 457a40ff03..e201f1eb04 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -195,9 +195,6 @@ void QCocoaWindow::initialize() [m_view setWantsBestResolutionOpenGLSurface:enable]; // See also QCocoaGLContext::makeCurrent for software renderer workarounds. } - BOOL enable = qt_mac_resolveOption(NO, window(), "_q_mac_wantsLayer", - "QT_MAC_WANTS_LAYER"); - [m_view setWantsLayer:enable]; } setGeometry(initialGeometry(window(), windowGeometry(), defaultWindowWidth, defaultWindowHeight)); diff --git a/src/plugins/platforms/cocoa/qnsview_drawing.mm b/src/plugins/platforms/cocoa/qnsview_drawing.mm index 68c41ba5f1..a2509ccb72 100644 --- a/src/plugins/platforms/cocoa/qnsview_drawing.mm +++ b/src/plugins/platforms/cocoa/qnsview_drawing.mm @@ -136,6 +136,18 @@ } } +- (BOOL)wantsLayer +{ + Q_ASSERT(m_platformWindow); + + // Toggling the private QWindow property or the environment variable + // on and off is not a supported use-case, so this code is effectively + // returning a constant for the lifetime of our QSNSView, which means + // we don't care about emitting KVO signals for @"wantsLayer". + return qt_mac_resolveOption(false, m_platformWindow->window(), + "_q_mac_wantsLayer", "QT_MAC_WANTS_LAYER"); +} + - (void)displayLayer:(CALayer *)layer { Q_ASSERT(layer == self.layer);