aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/native/NewtMacWindow.m
diff options
context:
space:
mode:
authorRami Santina <[email protected]>2010-10-21 12:34:51 +0300
committerRami Santina <[email protected]>2010-10-21 12:34:51 +0300
commit9efc951e53c41e21a0c8bfed6dcc22762d9b413c (patch)
treeaa580de9a7848bbc0b0aa132f2904cbb399c34e2 /src/newt/native/NewtMacWindow.m
parent29891baca2427483f96e6d1a8c3b13892ba5facc (diff)
parent18bf27fa86da1f26fd085565f501736816d2f2e9 (diff)
Merge branch 'master' of http://github.com/sgothel/jogl
18bf27fa86da1f26fd085565f501736816d2f2e9 Conflicts resolved: src/newt/classes/com/jogamp/newt/impl/WindowImpl.java src/newt/classes/com/jogamp/newt/impl/windows/WindowsWindow.java src/newt/classes/com/jogamp/newt/impl/x11/X11Window.java src/newt/native/WindowsWindow.c src/newt/native/X11Window.c
Diffstat (limited to 'src/newt/native/NewtMacWindow.m')
-rw-r--r--src/newt/native/NewtMacWindow.m23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/newt/native/NewtMacWindow.m b/src/newt/native/NewtMacWindow.m
index da31a686e..9f9442e9d 100644
--- a/src/newt/native/NewtMacWindow.m
+++ b/src/newt/native/NewtMacWindow.m
@@ -100,12 +100,23 @@ jint GetDeltaY(NSEvent *event, jint javaMods) {
}
}
-/** FIXME: Tried child window: message reception ..
- (void)viewWillDraw
{
fprintf(stderr, "*************** viewWillDraw: 0x%p", javaWindowObject); fflush(stderr);
[super viewWillDraw];
-} */
+}
+
+- (void)viewDidHide
+{
+ (*env)->CallVoidMethod(env, javaWindowObject, visibleChangedID, JNI_FALSE);
+ [super viewDidHide];
+}
+
+- (void)viewDidUnhide
+{
+ (*env)->CallVoidMethod(env, javaWindowObject, visibleChangedID, JNI_TRUE);
+ [super viewDidUnhide];
+}
@end
@@ -113,6 +124,7 @@ static jmethodID sendMouseEventID = NULL;
static jmethodID sendKeyEventID = NULL;
static jmethodID insetsChangedID = NULL;
static jmethodID sizeChangedID = NULL;
+static jmethodID visibleChangedID = NULL;
static jmethodID positionChangedID = NULL;
static jmethodID focusChangedID = NULL;
static jmethodID windowDestroyNotifyID = NULL;
@@ -124,13 +136,14 @@ static jmethodID windowDestroyedID = NULL;
{
sendMouseEventID = (*env)->GetMethodID(env, clazz, "sendMouseEvent", "(IIIIII)V");
sendKeyEventID = (*env)->GetMethodID(env, clazz, "sendKeyEvent", "(IIIC)V");
- sizeChangedID = (*env)->GetMethodID(env, clazz, "sizeChanged", "(II)V");
+ sizeChangedID = (*env)->GetMethodID(env, clazz, "sizeChanged", "(IIZ)V");
+ visibleChangedID = (*env)->GetMethodID(env, clazz, "visibleChanged", "(Z)V");
insetsChangedID = (*env)->GetMethodID(env, clazz, "insetsChanged", "(IIII)V");
positionChangedID = (*env)->GetMethodID(env, clazz, "positionChanged", "(II)V");
focusChangedID = (*env)->GetMethodID(env, clazz, "focusChanged", "(Z)V");
windowDestroyNotifyID = (*env)->GetMethodID(env, clazz, "windowDestroyNotify", "()V");
windowDestroyedID = (*env)->GetMethodID(env, clazz, "windowDestroyed", "()V");
- if (sendMouseEventID && sendKeyEventID && sizeChangedID && insetsChangedID &&
+ if (sendMouseEventID && sendKeyEventID && sizeChangedID && visibleChangedID && insetsChangedID &&
positionChangedID && focusChangedID && windowDestroyedID && windowDestroyNotifyID)
{
return YES;
@@ -398,7 +411,7 @@ static jint mods2JavaMods(NSUInteger mods)
(*env)->CallVoidMethod(env, javaWindowObject, sizeChangedID,
(jint) contentRect.size.width,
- (jint) contentRect.size.height);
+ (jint) contentRect.size.height, JNI_FALSE);
}
- (void)windowDidMove: (NSNotification*) notification