From 3e62e462223db4cf861a7ca516c118bfea6cc9d6 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 6 May 2010 01:32:47 +0200 Subject: NEWT Windows: Add reparenting for fullscreen on child window --- src/newt/native/WindowsWindow.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/newt/native/WindowsWindow.c') 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); } -- cgit v1.2.3