From 6aa1d81c2f4d97f1a615e8da721c88779e3b54ff Mon Sep 17 00:00:00 2001 From: Anton Tarasov Date: Mon, 23 Jun 2008 14:42:53 +0400 Subject: [PATCH] 6682536: java\awt\FullScreen\NonfocusableFrameFullScreenTest\NonfocusableFrameFullScreenTest.java fails Always-on-top property should be restored on exiting full-screen. Reviewed-by: tdv --- .../windows/native/sun/windows/awt_Win32GraphicsDevice.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jdk/src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp b/jdk/src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp index ff144bc61a0..6d59689cb0f 100644 --- a/jdk/src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp +++ b/jdk/src/windows/native/sun/windows/awt_Win32GraphicsDevice.cpp @@ -1107,6 +1107,10 @@ Java_sun_awt_Win32GraphicsDevice_exitFullScreenExclusive( } } } 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 @@ Java_sun_awt_Win32GraphicsDevice_exitFullScreenExclusive( "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;