diff options
author | Sven Gothel <[email protected]> | 2010-12-23 06:26:47 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-12-23 06:26:47 +0100 |
commit | e7778124162aef7004e040dded5de1eaf5e1ece4 (patch) | |
tree | b750b24a7d3e5c3e008701760af7e9b74b43f4b4 /src/newt/native/NewtMacWindow.m | |
parent | 1c2a11a54949188d6704558f7fa38ecf8e811118 (diff) |
NEWT: Add WindowListener.windowDestroyed() ; Remove WindowImpl.windowDestroyed()
Add WindowListener.windowDestroyed()
To expose a proper window lifecycle, ie destroy-notify and destroyed,
this notification is added.
This will be used at least in unit tests, where we verify destruction.
Remove WindowImpl.windowDestroyed():
This native hook (planned to be called by native destroy notification)
is unreliable or not supported for all platforms.
NEWT relies on the pre destroy native hooks and handles the final
destroy notification itself.
Diffstat (limited to 'src/newt/native/NewtMacWindow.m')
-rw-r--r-- | src/newt/native/NewtMacWindow.m | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/newt/native/NewtMacWindow.m b/src/newt/native/NewtMacWindow.m index 2d8a84b4b..cba69498a 100644 --- a/src/newt/native/NewtMacWindow.m +++ b/src/newt/native/NewtMacWindow.m @@ -80,7 +80,6 @@ static jmethodID visibleChangedID = NULL; static jmethodID positionChangedID = NULL; static jmethodID focusChangedID = NULL; static jmethodID windowDestroyNotifyID = NULL; -static jmethodID windowDestroyedID = NULL; @implementation NewtView - (void) setJNIEnv: (JNIEnv*) theEnv @@ -142,9 +141,8 @@ static jmethodID windowDestroyedID = NULL; 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 && visibleChangedID && insetsChangedID && - positionChangedID && focusChangedID && windowDestroyedID && windowDestroyNotifyID) + positionChangedID && focusChangedID && windowDestroyNotifyID) { return YES; } @@ -456,7 +454,6 @@ static jint mods2JavaMods(NSUInteger mods) (*env)->CallVoidMethod(env, javaWindowObject, windowDestroyNotifyID); // Can't issue call here - locked window state, done from Java method - // (*env)->CallVoidMethod(env, javaWindowObject, windowDestroyedID); // No OSX hook for DidClose, so do it here // EOL .. (*env)->DeleteGlobalRef(env, javaWindowObject); |