From 4e0eb391d6c64f956ea5c87c0385ab48a24b2175 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Tue, 1 May 2012 09:21:14 +0200 Subject: Fix Bug 560 and NEWT window closing behavior in general for all platforms. - NEWT/WindowImpl: - 'void windowDestroyNotify()' -> 'boolean windowDestroyNotify(boolean force)', allowing to signal a forced close, as well as replying whether the window has been closed. (called by native code) - destroy(): set states before releasing the window lock - NEWT/X11: Pass windowDeleteAtom for reconfigure window, in case of reparenting child to top-level - NEWT/OSX: - Add 'BOOL windowShouldClose()' impl., ie. having a chance to reject the close attempt - Common impl. for 'windowShouldClose' and 'windowWillClose' -> 'windowClosingImpl' utilizing new 'windowDestroyNotify' code (see above). Fixes bug 560. - NEWT/JOGLNewtApplet1Run: Refine out-of browser window behavior for window-close button - default: move NEWT window back to browser parent - closeable: close NEWT window - jogl-test-applets: Add NApplet-Closeable test (Applet out-of browser window is closable) --- src/newt/native/NewtMacWindow.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/newt/native/NewtMacWindow.h') diff --git a/src/newt/native/NewtMacWindow.h b/src/newt/native/NewtMacWindow.h index aa460ea88..c0912ad3c 100644 --- a/src/newt/native/NewtMacWindow.h +++ b/src/newt/native/NewtMacWindow.h @@ -110,6 +110,7 @@ BOOL mouseVisible; BOOL mouseInside; BOOL cursorIsHidden; + BOOL realized; NSPoint lastInsideMousePosition; @public int cachedInsets[4]; // l, r, t, b @@ -125,6 +126,8 @@ isFullscreenWindow:(BOOL)isfs; - (void) release; - (void) dealloc; +- (void) setUnrealized; +- (BOOL) isRealized; - (void) updateInsets: (JNIEnv*) env; - (void) attachToParent: (NSWindow*) parent; @@ -166,5 +169,10 @@ - (void) rightMouseUp: (NSEvent*) theEvent; - (void) otherMouseDown: (NSEvent*) theEvent; - (void) otherMouseUp: (NSEvent*) theEvent; +- (void) windowDidResize: (NSNotification*) notification; +- (void) windowDidMove: (NSNotification*) notification; +- (BOOL) windowClosingImpl: (BOOL) force; +- (BOOL) windowShouldClose: (id) sender; +- (void) windowWillClose: (NSNotification*) notification; @end -- cgit v1.2.3