aboutsummaryrefslogtreecommitdiffstats
path: root/src/native
diff options
context:
space:
mode:
authorKenneth Russel <[email protected]>2009-01-06 08:13:09 +0000
committerKenneth Russel <[email protected]>2009-01-06 08:13:09 +0000
commit2f986f2052144764d698da05a178d22c4754b563 (patch)
treefb3c8740a7896e93b8ea70be24caabd5ce9ce0b4 /src/native
parent3aee79d92e58f0ca82b737b0099bbc52abded952 (diff)
Added GLCapabilities.setBackgroundOpaque() and isBackgroundOpaque()
for shaped window support on Mac OS X, and modified MacOSXCGLContext to pay attention to this bit. Changed Mac OS X port of Newt to make window non-opaque if borderless, and still allow it to receive the keyboard focus. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1841 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src/native')
-rw-r--r--src/native/newt/MacWindow.m7
-rw-r--r--src/native/newt/NewtMacWindow.m7
2 files changed, 14 insertions, 0 deletions
diff --git a/src/native/newt/MacWindow.m b/src/native/newt/MacWindow.m
index 5b479e05d..6dca9b93b 100644
--- a/src/native/newt/MacWindow.m
+++ b/src/native/newt/MacWindow.m
@@ -137,6 +137,13 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_macosx_MacWindow_createWindow
defer: YES
javaWindowObject: windowObj] retain];
+ // If the window is undecorated, assume we want the possibility of
+ // a shaped window, so make it non-opaque and the background color clear
+ if ((styleMask & NSTitledWindowMask) == 0) {
+ [window setOpaque: NO];
+ [window setBackgroundColor: [NSColor clearColor]];
+ }
+
// Immediately re-position the window based on an upper-left coordinate system
setFrameTopLeftPoint(window, x, y);
diff --git a/src/native/newt/NewtMacWindow.m b/src/native/newt/NewtMacWindow.m
index 5655f2fa6..d0cf6ad15 100644
--- a/src/native/newt/NewtMacWindow.m
+++ b/src/native/newt/NewtMacWindow.m
@@ -82,6 +82,13 @@ static JNIEnv* env = NULL;
return res;
}
+- (BOOL) canBecomeKeyWindow
+{
+ // Even if the window is borderless, we still want it to be able
+ // to become the key window to receive keyboard events
+ return YES;
+}
+
static jint mods2JavaMods(NSUInteger mods)
{
int javaMods = 0;