diff options
author | Sven Gothel <[email protected]> | 2012-05-01 09:21:14 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2012-05-01 09:21:14 +0200 |
commit | 4e0eb391d6c64f956ea5c87c0385ab48a24b2175 (patch) | |
tree | 69f0f45c73fc7fe2a95a678e75fa5fb4262911db /src/newt/native/X11Window.c | |
parent | 5742b1faa210401470032ef129e56a83c47fd046 (diff) |
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)
Diffstat (limited to 'src/newt/native/X11Window.c')
-rw-r--r-- | src/newt/native/X11Window.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/newt/native/X11Window.c b/src/newt/native/X11Window.c index 9d4ff5aaa..0f93b3e76 100644 --- a/src/newt/native/X11Window.c +++ b/src/newt/native/X11Window.c @@ -730,11 +730,13 @@ static Bool WaitForReparentNotify( Display *dpy, XEvent *event, XPointer arg ) { * Signature: (JIJJIIIII)V */ JNIEXPORT void JNICALL Java_jogamp_newt_driver_x11_X11Window_reconfigureWindow0 - (JNIEnv *env, jobject obj, jlong jdisplay, jint screen_index, jlong jparent, jlong jwindow, + (JNIEnv *env, jobject obj, jlong jdisplay, jint screen_index, + jlong jparent, jlong jwindow, jlong windowDeleteAtom, jint x, jint y, jint width, jint height, jint flags) { Display * dpy = (Display *) (intptr_t) jdisplay; Window w = (Window)jwindow; + Atom wm_delete_atom = (Atom)windowDeleteAtom; Window root = RootWindow(dpy, screen_index); Window parent = (0!=jparent)?(Window)jparent:root; XEvent event; @@ -810,6 +812,7 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_x11_X11Window_reconfigureWindow0 XReparentWindow( dpy, w, parent, x, y ); // actual reparent call // XIfEvent( dpy, &event, WaitForReparentNotify, (XPointer) w ); XSync(dpy, False); + XSetWMProtocols(dpy, w, &wm_delete_atom, 1); // windowDeleteAtom } if( TST_FLAG_CHANGE_DECORATION(flags) ) { |