macOS: Make [QNSView wantsLayer] declarative
Change-Id: Ib5dc8178293d13542a54d51484181debd57580f5 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
This commit is contained in:
parent
62f053c19b
commit
c8c8cc790a
@ -195,9 +195,6 @@ void QCocoaWindow::initialize()
|
|||||||
[m_view setWantsBestResolutionOpenGLSurface:enable];
|
[m_view setWantsBestResolutionOpenGLSurface:enable];
|
||||||
// See also QCocoaGLContext::makeCurrent for software renderer workarounds.
|
// 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));
|
setGeometry(initialGeometry(window(), windowGeometry(), defaultWindowWidth, defaultWindowHeight));
|
||||||
|
@ -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
|
- (void)displayLayer:(CALayer *)layer
|
||||||
{
|
{
|
||||||
Q_ASSERT(layer == self.layer);
|
Q_ASSERT(layer == self.layer);
|
||||||
|
Loading…
Reference in New Issue
Block a user