diff options
author | Sven Gothel <[email protected]> | 2011-09-09 17:53:25 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-09-09 17:53:25 +0200 |
commit | de9a419a315d16edee2c5da74bbf7ea1f89bef30 (patch) | |
tree | 9f5536fd5e0b273fbd3bd630894be0a854a6ebcf /src/newt/native | |
parent | a59026f8956c9291e6e3c8b9defd618586edd742 (diff) |
NEWT/Window: CreateWindow - Wait for user req. position: Fix about window-decoration/insets size
Diffstat (limited to 'src/newt/native')
-rw-r--r-- | src/newt/native/WindowsWindow.c | 4 | ||||
-rw-r--r-- | src/newt/native/X11Window.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/newt/native/WindowsWindow.c b/src/newt/native/WindowsWindow.c index 1cb0f2036..6990bcb83 100644 --- a/src/newt/native/WindowsWindow.c +++ b/src/newt/native/WindowsWindow.c @@ -1388,9 +1388,11 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_windows_WindowsWindow_CreateWind BOOL userPos = 0<=x && 0<=y ; ShowWindow(window, SW_SHOW); - (*env)->CallVoidMethod(env, wud->jinstance, visibleChangedID, JNI_TRUE); + // send insets before visibility, allowing java code a proper sync point! insets = UpdateInsets(env, wud->jinstance, window); + (*env)->CallVoidMethod(env, wud->jinstance, visibleChangedID, JNI_TRUE); + if(!userPos) { GetWindowRect(window, &rc); x = rc.left + insets->left; // client coords diff --git a/src/newt/native/X11Window.c b/src/newt/native/X11Window.c index 39e8f9476..90b16a5c3 100644 --- a/src/newt/native/X11Window.c +++ b/src/newt/native/X11Window.c @@ -1618,9 +1618,11 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_x11_X11Window_CreateWindow0 XMapWindow(dpy, window); XIfEvent( dpy, &event, WaitForMapNotify, (XPointer) window ); // wait to get proper insets values - (*env)->CallVoidMethod(env, jwindow, visibleChangedID, JNI_TRUE); + // send insets before visibility, allowing java code a proper sync point! NewtWindows_updateInsets(env, jwindow, dpy, window, &left, &right, &top, &bottom); + (*env)->CallVoidMethod(env, jwindow, visibleChangedID, JNI_TRUE); + if(!userPos) { // get position from WM int dest_x, dest_y; |