changeset 549:9b66576b81f0

6682536: java\awt\FullScreen\NonfocusableFrameFullScreenTest\NonfocusableFrameFullScreenTest.java fails Summary: always-on-top property should be restored on exiting full-screen. Reviewed-by: tdv
author ant
date Mon, 23 Jun 2008 14:42:53 +0400
parents fae7c1f5ba78
children 59e34bb65340
files src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp	Thu Jun 19 16:09:22 2008 +0400
+++ b/src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp	Mon Jun 23 14:42:53 2008 +0400
@@ -1107,6 +1107,10 @@
             }
         }
     } else {
+        jobject target = env->GetObjectField(windowPeer, AwtObject::targetID);
+        jboolean alwaysOnTop = JNU_GetFieldByName(env, NULL, target, "alwaysOnTop", "Z").z;
+        env->DeleteLocalRef(target);
+
         if (!::SetWindowPos(hWnd, HWND_NOTOPMOST, 0, 0, 0, 0,
                             SWP_NOMOVE|SWP_NOOWNERZORDER|SWP_NOSIZE))
         {
@@ -1114,6 +1118,9 @@
                         "Error %d unsetting topmost attribute to fs window",
                         ::GetLastError());
         }
+
+        // We should restore alwaysOnTop state as it's anyway dropped here
+        Java_sun_awt_windows_WWindowPeer_setAlwaysOnTopNative(env, windowPeer, alwaysOnTop);
     }
 
     CATCH_BAD_ALLOC;