diff options
author | Gunnar Sletta <gunnar.sletta@digia.com> | 2013-02-20 15:50:35 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-23 15:31:33 +0100 |
commit | bc616641a1c3d2d79cf7c5ee9e80a59279edb756 (patch) | |
tree | b3f1c08a8233ae0bd3cf31eefdb67c5a6fbef4b0 /src/plugins/platforms/cocoa/qcocoaglcontext.mm | |
parent | 0077b5f30de7190227317247609c820f37466960 (diff) |
Make toplevel transparent windows work on Mac OS X
This patch includes a few different fixes to make transparent toplevels
work on cocoa.
- When setting alpha on the toplevel, it also needs setOpaque:NO
- The OpenGL context needs a separate flag for this to work.
- Make sure setOpaque fighting between setMask, setFormat and
setOpacity ends up correctly
Task-number: QTBUG-28214
Change-Id: Ic3a2d71193bb653e181c98787b4ebda002424092
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaglcontext.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaglcontext.mm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm index 6c2fdf5470..d4673baaef 100644 --- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm +++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm @@ -78,6 +78,10 @@ QCocoaGLContext::QCocoaGLContext(const QSurfaceFormat &format, QPlatformOpenGLCo const GLint interval = 1; [m_context setValues:&interval forParameter:NSOpenGLCPSwapInterval]; + if (format.alphaBufferSize() > 0) { + int zeroOpacity = 0; + [m_context setValues:&zeroOpacity forParameter:NSOpenGLCPSurfaceOpacity]; + } } QCocoaGLContext::~QCocoaGLContext() |