aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-05-06 01:32:47 +0200
committerSven Gothel <[email protected]>2010-05-06 01:32:47 +0200
commit3e62e462223db4cf861a7ca516c118bfea6cc9d6 (patch)
tree2aeab398bcbccb59f732a54901d166af5a508b72
parentf3cd476a00e86da9963d4a5c705022e82d5d2059 (diff)
NEWT Windows: Add reparenting for fullscreen on child window
-rwxr-xr-xsrc/newt/native/WindowsWindow.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/newt/native/WindowsWindow.c b/src/newt/native/WindowsWindow.c
index a3ff7d6c7..b500e3217 100755
--- a/src/newt/native/WindowsWindow.c
+++ b/src/newt/native/WindowsWindow.c
@@ -1293,6 +1293,17 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_setFullsc
HWND hWndInsertAfter;
DWORD windowStyle = WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE;
+ if ( JNI_TRUE == on ) {
+ hwndP = NULL; // full-screen is top level
+ }
+
+ // order of call sequence: (MS documentation)
+ // SetParent(.., NULL), SetWindowLong ( WS_POPUP )
+ // SetParent(.., PARENT), SetWindowLong ( WS_CHILD )
+ if ( NULL == hwndP ) {
+ SetParent(hwnd, NULL);
+ }
+
if(NULL!=hwndP) {
windowStyle |= WS_CHILD ;
} else if (bIsUndecorated || on) {
@@ -1302,6 +1313,10 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_setFullsc
}
SetWindowLong(hwnd, GWL_STYLE, windowStyle);
+ if ( NULL != hwndP ) {
+ SetParent(hwnd, hwndP );
+ }
+
if(on==JNI_TRUE) {
flags = SWP_SHOWWINDOW;
hWndInsertAfter = HWND_TOPMOST;
@@ -1312,7 +1327,7 @@ JNIEXPORT void JNICALL Java_com_jogamp_newt_impl_windows_WindowsWindow_setFullsc
SetWindowPos(hwnd, hWndInsertAfter, x, y, width, height, flags);
- NewtWindows_requestFocus ( wnd );
+ NewtWindows_requestFocus ( hwnd );
(*env)->CallVoidMethod(env, obj, sizeChangedID, (jint) width, (jint) height);
}