aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2018-01-15 07:21:41 +0100
committerSven Gothel <[email protected]>2018-01-15 07:21:41 +0100
commitd590c5df17650b3790bb434fb7529df874914a09 (patch)
treec4893926f5fd6a085b942f5849dc5fbc4c5c1d38
parentec05537be8a1355d74c86d0f3b4509ec3dc653f5 (diff)
Bug 1299: Fix Warning when using JOGL on Mac OS X El Capitan
It turned out to be a missing CATransaction, i.e. the native create/destroy commands had to be encapsulated within [CATransaction begin] and [CATransaction commit] causing the uncommitted CATransaction.
-rw-r--r--src/nativewindow/native/macosx/OSXmisc.m7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nativewindow/native/macosx/OSXmisc.m b/src/nativewindow/native/macosx/OSXmisc.m
index ce4a3b7ee..80ddee415 100644
--- a/src/nativewindow/native/macosx/OSXmisc.m
+++ b/src/nativewindow/native/macosx/OSXmisc.m
@@ -336,6 +336,7 @@ JNIEXPORT jlong JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_CreateNSWindow0
(JNIEnv *env, jclass unused, jint x, jint y, jint width, jint height)
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+ [CATransaction begin];
NSRect rect = NSMakeRect(x, y, width, height);
// Allocate the window
@@ -365,6 +366,7 @@ NS_ENDHANDLER
// [myView lockFocus];
// [myView unlockFocus];
+ [CATransaction commit];
[pool release];
return (jlong) ((intptr_t) myWindow);
@@ -379,9 +381,12 @@ JNIEXPORT void JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_DestroyNSWindow0
(JNIEnv *env, jclass unused, jlong nsWindow)
{
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
- NSWindow* mWin = (NSWindow*) ((intptr_t) nsWindow);
+ [CATransaction begin];
+ NSWindow* mWin = (NSWindow*) ((intptr_t) nsWindow);
[mWin close]; // performs release!
+
+ [CATransaction commit];
[pool release];
}